Contributing
Help improve GoLearn by contributing exercises, fixing bugs, or improving documentation.
Ways to Contribute
- Bug Reports: Report issues on GitHub
- New Exercises: Create exercises for Go concepts
- Documentation: Improve guides and examples
- Code: Fix bugs and add features
Getting Started
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/golearn.git
- Create a branch:
git checkout -b your-feature-name
- Make your changes and test them
- Commit and push:
git commit -m "Your message"
- Create a pull request on GitHub
Creating Exercises
Each exercise needs:
- Template file (incomplete code for learners to complete)
- Test file (verification tests)
- Solution file (complete implementation, base code is already in place which will run the test cases written for template to picked for solutions as well)
- Catalog entry in
catalog.yaml
Code Style
- Follow Effective Go guidelines
- Use
gofmt
to format code - Run
go vet
to check for issues - Write clear, descriptive commit messages
Testing
Before submitting your changes, build locally and verify exercises using the CLI:
# Build the CLI
go build -o bin/golearn ./cmd/golearn
chmod +x bin/golearn
# Verify template exercises (incomplete templates should fail)
./bin/golearn verify
# Verify a specific exercise with its solution (should pass)
./bin/golearn verify 01_hello --solution