Thank you for your interest in contributing to Go Micro! This document provides guidelines and instructions for contributing.
Be respectful, inclusive, and collaborative. We're all here to build great software together.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/go-micro.git - Add upstream remote:
git remote add upstream https://github.com/micro/go-micro.git - Create a feature branch:
git checkout -b feature/my-feature
# Install dependencies
go mod download
# Install development tools
make install-tools
# Run tests
make test
# Run tests with race detector and coverage
make test-coverage
# Run linter
make lint
# Format code
make fmtSee make help for all available commands.
- Follow standard Go conventions (use
gofmt,golint) - Write clear, descriptive commit messages
- Add tests for new functionality
- Update documentation for API changes
- Keep PRs focused - one feature/fix per PR
Use conventional commits format:
type(scope): subject
body
footer
Types:
feat: New featurefix: Bug fixdocs: Documentation changestest: Test additions/changesrefactor: Code refactoringperf: Performance improvementschore: Maintenance tasks
Examples:
feat(registry): add kubernetes registry plugin
fix(broker): resolve nats connection leak
docs(examples): add streaming example
- Write unit tests for all new code
- Ensure existing tests pass
- Add integration tests for plugin implementations
- Test with multiple Go versions (1.20+)
# Run specific package tests
go test ./registry/...
# Run with verbose output
go test -v ./...
# Run specific test
go test -run TestMyFunction ./pkg/...
# Optional: Use richgo for colored output
go install github.com/kyoh86/richgo@latest
richgo test -v ./...- Update relevant markdown files in
internal/website/docs/ - Add examples to
internal/website/docs/examples/for new features - Update README.md for major features
- Add godoc comments for exported functions/types
-
Update your branch
git fetch upstream git rebase upstream/master
-
Run tests and linting
go test ./... golangci-lint run -
Push to your fork
git push origin feature/my-feature
-
Create Pull Request
- Use a descriptive title
- Reference any related issues
- Describe what changed and why
- Add screenshots for UI changes
- Mark as draft if work in progress
-
PR Review
- Respond to feedback promptly
- Make requested changes
- Re-request review after updates
- Tests pass locally
- Code follows Go conventions
- Documentation updated
- Commit messages are clear
- Branch is up to date with master
- No merge conflicts
New plugins should:
- Live in the appropriate interface directory (e.g.,
registry/myplugin/) - Implement the interface completely
- Include comprehensive tests
- Provide usage examples
- Document configuration options (env vars, options)
- Add to plugin documentation
Example structure:
registry/myplugin/
├── myplugin.go # Main implementation
├── myplugin_test.go # Tests
├── options.go # Plugin-specific options
└── README.md # Usage and configuration
Before creating an issue:
- Search existing issues
- Check documentation
- Try the latest version
When reporting bugs:
- Use the bug report template
- Include minimal reproduction code
- Specify versions (Go, Go Micro, plugins)
- Provide relevant logs
Documentation improvements are always welcome!
- Fix typos and grammar
- Improve clarity
- Add missing examples
- Update outdated information
Documentation lives in internal/website/docs/. Preview locally with Jekyll:
cd internal/website
bundle install
bundle exec jekyll serve --livereload- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: Questions, ideas, and community chat
- Sponsorship: GitHub Sponsors
Maintainers handle releases:
- Update CHANGELOG.md
- Tag release:
git tag -a v5.x.x -m "Release v5.x.x" - Push tag:
git push origin v5.x.x - GitHub Actions creates release
- Check documentation
- Browse examples
- Open a question issue
Thank you for contributing to Go Micro! 🎉