Contribution Guidelines

Contributions Welcome

Thank you for considering contributing to the Go-Common! This document provides guidelines for contributing to this project.

How to Contribute

1. Fork and Clone

git clone https://github.com/YOUR_USERNAME/go-common.git
cd go-common

2. Create a Branch

git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-description

3. Make Changes

  • Follow existing code patterns and conventions

  • Add comprehensive documentation for new features

  • Include examples in /example directories where applicable

  • Write tests for new functionality

4. Run Tests and Linting

5. Submit a Pull Request

  • Ensure all tests pass and coverage is maintained

  • Update relevant README files

  • Include clear commit messages

  • Reference any related issues

Code Guidelines

Documentation

  • All public functions and types must have Go doc comments

  • Follow the existing documentation style (concise but comprehensive)

  • Include practical examples in comments

  • Update README files for new packages

Testing

  • Maintain test coverage above 90%

  • Write table-driven tests where appropriate

  • Include both positive and negative test cases

  • Use mock interfaces for testing

Code Style

  • Follow standard Go conventions

  • Use meaningful variable and function names

  • Keep functions focused and single-purpose

  • Handle errors appropriately

Package Structure

When adding new packages, follow the existing structure:

Celebrate 🎉

Once your pull request is merged, take a moment to celebrate your contribution! Thank you for helping improve Go-Common.

Last updated