Skip to content

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!

  1. Fork the Repository: Start by forking the Goose repository.
  2. Create a Branch: Create a feature branch from main (git checkout -b feature/my-new-feature).
  3. Write Code: Implement your changes. Ensure you adhere to idiomatic Go practices.
  4. Write Tests: Goose aims for high test coverage. Please write unit tests for your changes.
  5. Run Tests: Make sure all existing and new tests pass (go test ./...).
  6. Commit: Write clear, descriptive commit messages.
  7. Push: Push your branch to your fork.
  8. Open a PR: Submit a Pull Request against the main branch 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.Context as 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 gofmt before committing.

Documentation

Documentation is hosted using MkDocs with the Material theme. To preview documentation locally:

  1. Install MkDocs and MkDocs Material.
  2. Run mkdocs serve in the project root.
  3. Visit http://localhost:8000.

Thank you for contributing to Goose! 🦆