Contributing to Goose¶
First off, thank you for considering contributing to Goose! It's people like you that make the open-source community such an amazing place to learn, inspire, and create.
Code of Conduct¶
By participating in this project, you are expected to uphold standard open-source community standards. Please be respectful, welcoming, and collaborative.
How Can I Contribute?¶
Reporting Bugs¶
If you find a bug, please create an issue on GitHub. Include:
- Your Go version (
go version) - Your Goose version
- Your MongoDB server version
- A minimal, reproducible example demonstrating the issue
- What you expected to happen vs what actually happened
Suggesting Enhancements¶
Have an idea to make Goose better? Great! Open an issue outlining:
- The motivation behind the feature
- How it should work (API design)
- Potential alternatives considered
Pull Requests¶
We welcome pull requests for bug fixes, features, and documentation updates!
- Fork the Repository: Start by forking the Goose repository.
- Create a Branch: Create a feature branch from
main(git checkout -b feature/my-new-feature). - Write Code: Implement your changes. Ensure you adhere to idiomatic Go practices.
- Write Tests: Goose aims for high test coverage. Please write unit tests for your changes.
- Run Tests: Make sure all existing and new tests pass (
go test ./...). - Commit: Write clear, descriptive commit messages.
- Push: Push your branch to your fork.
- Open a PR: Submit a Pull Request against the
mainbranch of the official Goose repository.
Development Guidelines¶
- Go Version: Goose requires Go 1.18+ due to its reliance on Generics.
- Context First: Ensure all functions performing I/O take
context.Contextas their first parameter. - Errors: Use
fmt.Errorf("goose: ...: %w", err)for wrapping errors to provide clear stack traces. - Documentation: Every exported type, function, and method must have a valid godoc comment.
- Formatting: Ensure your code is formatted using
gofmtbefore committing.
Documentation¶
Documentation is hosted using MkDocs with the Material theme. To preview documentation locally:
- Install MkDocs and MkDocs Material.
- Run
mkdocs servein the project root. - Visit
http://localhost:8000.
Thank you for contributing to Goose! 🦆