Hey everyone
Are you passionate about GoLang and open-source? Want to make your first contribution and earn some cool swags along the way? Here's a step-by-step guide to contributing to the GoFr project—a high-performance Golang framework built for reliability, testability, and scalability.
Whether you're fixing typos, refactoring code, writing tests, or improving documentation, this guide will help you contribute the right way!
What is GoFr?
GoFr is a GoLang-based microservices framework focused on performance and developer experience. It emphasizes clean code practices, test-driven development, and dependency injection—all backed by strong community standards.
Minor Contributions: Edit on the Fly
Small changes like:
• Fixing typos
• Renaming variables
• Improving error messages
...can be made directly on GitHub. Just hit the edit button on any file, GitHub will automatically create a temporary branch and a pull request (PR) for you. ✅
This is perfect for first-time contributors!
Want to Work on a Bigger Issue?
Follow these steps:
- Browse open issues on GitHub.
- Comment on the issue and request assignment.
- Wait for a maintainer to assign it to you.
- Start building! ⚠️ Avoid working on unassigned issues to prevent duplicated efforts.
⚠️ Triage Issues? Read This
Issues labeled with triage aren’t open for direct contributions. If you’re interested in working on one, first comment and ask for maintainer approval.
Code Formatting & Linting
Before committing your changes, make sure your code is formatted using:
• goimports
• golangci-lint
If you don’t, the pipeline will reject your PR. Save your time — set up your IDE to auto-format on save!
Testing is Not Optional
Every code change must be backed by tests:
• Unit Tests for all new methods/functions.
• Integration Tests for large features.
• Use table-driven tests for multiple scenarios.
Zero tolerance for decreased code coverage. The code-climate check will fail if test coverage drops.
Testing with Docker
GoFr uses multiple services like MongoDB, Redis, Kafka, PostgreSQL, and more. You can spin them up with Docker:
docker run --name mongodb -d -p 27017:27017 mongo
docker run --name gofr-pgsql -d -e POSTGRES_DB=customers -e POSTGRES_PASSWORD=root123 -p 2006:5432 postgres:15.1
…and many more! Check the full list in the official contribution guide.
Submit Your Pull Request the Right Way
- Always submit PRs to the development branch.
- Don’t open PRs until your feature is complete and tested.
- All PRs must be reviewed by at least 2 GoFr developers before merging.
- Add/Update documentation if applicable.
- Use American English for consistency.
Documentation Matters
Improved docs = Better community.
• Update or add files in the development/docs/ folder.
• Add references to navigation.js.
• Add images to docs/public/ folder (if needed).
• Use Markdown standards.
You can also contribute by writing blog posts or tutorials—like this one
Coding Standards: Be a Pro
• No global variables.
• Use dependency injection (DB, logger, etc.).
• Don’t use init() functions.
• Exported functions must include GoDoc comments.
• Use context.Context as the first parameter (never use plain strings as keys).
• Lean interfaces: only take what you need.
• Avoid type assertions.
External Libraries
“A little copying is better than a little dependency.”
If you must use a library:
• Test the exact functionality you’ll rely on.
• Wrap it in an interface for easy replacement later.
Final Tip: Earn Swags & Recognition
Want to get noticed and earn swags? Here's what you can do:
• Star ⭐ the GoFr GitHub repository.
• Share your experience contributing to GoFr on platforms like Dev.to, Medium, or LinkedIn.
• Help review issues or guide others in GitHub Discussions.