Thank you for your interest in contributing! This document provides guidelines for contributing to the project.
-
Fork the repository
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/go-modulith-template.git cd go-modulith-template -
Install dependencies:
just install-deps
-
Start infrastructure:
just docker-up
-
Run tests:
just test just lint
git checkout -b feature/descriptive-nameEnsure you follow the project conventions:
- Go Code: Follow Go Code Review Comments
- Commits: Use descriptive commit messages
- Tests: Add tests for new functionality
- Documentation: Update relevant documentation
MANDATORY before committing:
# Linter (must pass with 0 errors)
just lint
# Tests
just test
# Coverage (optional but recommended)
just coverage-reportgit add .
git commit -m "feat: brief description of change"
git push origin feature/descriptive-name- Use a descriptive title
- Explain what changes and why
- Reference related issues (if applicable)
- Ensure CI passes
- Linting: The project uses
golangci-lintwith strict configuration - Formatting: All code must pass
gofmtandgoimports - Naming: Follow standard Go conventions
- Errors: Always wrap errors with context using
fmt.Errorf("context: %w", err)
- Unit tests: For business logic (use
gomockmocks) - Integration tests: For DB operations (with
-shortflag) - Minimum coverage: Aim for >60% on new code
- README: Update if you add visible features
- Code: Document public functions/types with GoDoc
- Docs: Update documents in
/docs/if relevant
Use semantic prefixes:
feat:- New featurefix:- Bug fixdocs:- Documentation changesrefactor:- Refactoring without behavior changetest:- Add or modify testschore:- Build, deps, etc. changes
When adding features, fixes, or important changes, update CHANGELOG.md:
- Add your change in the appropriate
[Unreleased]section - Use categories: Added, Changed, Deprecated, Removed, Fixed, Security
- Follow the existing format
- Changes will be moved to a specific version in the next release
When reporting a bug, include:
- Description: What you expected vs what happened
- Steps to reproduce
- Go version:
go version - Relevant logs: If applicable
To prloopcontexte new functionality:
- Open an issue first to discuss it
- Explain the use case
- Consider the architectural impact
- Wait for feedback before implementing
.golangci.yaml- Do not relax linting rulessqlc.yaml- Only change for new modulesbuf.yaml- Standard protobuf configuration
This is a modulith template:
- Maintain isolation between modules
- Use events for cross-module communication
- Follow the registry pattern for DI
- Document important architectural decisions
- Don't optimize prematurely
- If you add performance-critical code, include benchmarks
- Use
go test -bench=.to validate
- Be respectful and constructive
- Accept feedback with an open mind
- Focus on the code, not the people
- Help other contributors when you can
If you have questions, open an issue or discussion on GitHub.
Thank you for contributing! 🚀