The client uses main
as the main development branch. It contains all changes to the upcoming release.
We do our best to ensure a clean history. To do so, we ask contributors to squash their commits into a set or single logical commit.
To contribute to KurrentDB Client Go:
- Fork the repository.
- Create a feature branch from the
main
branch. - It's recommended that feature branches use a rebase strategy (see more in Git documentation). We also highly recommend using clear commit messages that represent the unit of change.
- Rebase the latest source branch from the main repository before sending PR.
- When ready to create the Pull Request on GitHub check to see what has previously changed.
Code samples are in the samples
folder. They're orchestrated in the separate documentation repository. The Kurrent Documentation site is publicly accessible at https://docs.kurrent.io/.
- Formatting: Use
gofmt
to format your code. This tool is the standard for Go code formatting and ensures consistency across the codebase. - Linting: Use
golint
to check for style mistakes. This tool helps maintain code quality by enforcing Go idioms and best practices. - Imports: Organize imports into three groups: standard library packages, third-party packages, and local packages. Separate these groups with a blank line.
- Comments: Use comments to explain the purpose of the code. Exported functions and types should have comments that start with the name of the function or type.
- Naming: Follow Go naming conventions. Use camelCase for variable names, PascalCase for exported names, and ALL_CAPS for constants.
- Error Handling: Handle errors explicitly. Check for errors and handle them appropriately. Do not ignore errors.
- Testing: Write tests for your code. Use the
testing
package and aim for high test coverage. Ensure tests are clear and concise. - Concurrency: Use goroutines and channels appropriately. Avoid common pitfalls
By contributing to KurrentDB Client Go:
- You assert that contribution is your original work
- You assert that you have the right to assign the copyright for the work
- You accept the Contributor License Agreement (CLA) for your contribution
- You accept the License