Thank you for considering contributing to go-common! Every contribution is welcome, whether it's a bug report, a feature request, or a pull request.
- Check the existing issues to see if the bug has already been reported.
- If not, open a new issue with:
- A clear and descriptive title
- Steps to reproduce the problem
- Expected vs. actual behavior
- Go version and OS
Open an issue with the feature request label. Describe the use case and why the feature would be useful.
- Fork the repository and create a new branch from
main. - Install dependencies:
go mod tidy
- Make your changes. Follow the conventions below.
- Run the tests:
go test ./... - Run static analysis (if staticcheck is installed):
staticcheck ./...
- Commit with a clear message describing what you changed and why.
- Open a Pull Request against
main.
- File naming: Name the primary file in a package after the package itself (e.g.
filter/filter.go), notmain.go. - Error handling: Return errors to the caller. Do not use
panic,log.Fatal, orfmt.Printlnfor error handling in library code. - Logging: Use the
logstandard library for warnings. Do not usefmt.Print*for log output. - GoDoc: All exported types, functions, and methods must have GoDoc comments.
- Deprecation: Use the standard Go
// Deprecated: ...comment format. - Testing: Use testify (
assert/require) for assertions. Userequirefor setup errors andassertfor value checks.
If you discover a security vulnerability, please do not open a public issue. Instead, refer to the Security Policy for instructions on responsible disclosure.
By contributing, you agree that your contributions will be licensed under the same license as the project (see LICENSE).