Thank you for your interest in contributing to FL-GO! This document provides guidelines and information for contributors.
- Go 1.23 or later
- Git
- Docker (optional)
- Node.js and npm (for web UI development)
-
Fork and clone the repository
git clone https://github.com/your-username/fl-go.git cd fl-go -
Setup development environment
make setup-dev
-
Install dependencies
go mod tidy make install-web-deps
-
Run tests to verify setup
make test
git checkout -b feature/your-feature-name- Follow the coding standards
- Write tests for new functionality
- Update documentation as needed
# Run all tests
make test
# Run specific test types
make test-unit
make test-integration
make test-security
# Run linting
make lint
# Format code
make formatFollow the conventional commits format:
git commit -m "feat: add new federated learning algorithm"
git commit -m "fix: resolve connection timeout issue"
git commit -m "docs: update API documentation"git push origin feature/your-feature-name- Follow Effective Go
- Use
gofmtfor formatting - Write meaningful comments for exported functions
- Keep functions small and focused
- Use meaningful variable names
- Place new packages in the
pkg/directory - Add new commands in the
cmd/directory - Update examples in the
examples/directory - Document changes in the
docs/directory
- Write unit tests for all new functionality
- Aim for at least 80% code coverage
- Use table-driven tests where appropriate
- Mock external dependencies
Example test structure:
func TestNewFeature(t *testing.T) {
tests := []struct {
name string
input string
expected string
}{
{"normal case", "input", "expected"},
{"edge case", "", ""},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := NewFeature(tt.input)
if result != tt.expected {
t.Errorf("got %s, want %s", result, tt.expected)
}
})
}
}- Document all exported functions and types
- Use godoc format
- Include examples for complex functions
- Update relevant documentation in
docs/ - Add examples in
examples/ - Update README.md if needed
-
Ensure all tests pass
make test -
Check code quality
make lint make format
-
Update documentation
- Add/update relevant docs
- Update examples if needed
- Update README if needed
-
Test your changes
- Test locally
- Test with different configurations
- Test edge cases
Use the following template for your PR:
## Description
Brief description of the changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing completed
## Documentation
- [ ] Code documentation updated
- [ ] User documentation updated
- [ ] Examples updated
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Tests pass locally
- [ ] Documentation updatedWhen reporting bugs, please include:
-
Environment information
- OS and version
- Go version
- FL-GO version
-
Steps to reproduce
- Clear, step-by-step instructions
- Minimal example if possible
-
Expected vs actual behavior
- What you expected to happen
- What actually happened
-
Additional context
- Logs and error messages
- Configuration files
- Screenshots if relevant
When requesting features, please include:
-
Problem description
- What problem are you trying to solve?
- Why is this important?
-
Proposed solution
- How should this work?
- Any specific requirements?
-
Use cases
- Who would benefit from this?
- How would they use it?
FL-GO follows semantic versioning:
- Major version: Breaking changes
- Minor version: New features, backward compatible
- Patch version: Bug fixes, backward compatible
Before releasing:
-
Update version
- Update version in relevant files
- Update CHANGELOG.md
-
Run full test suite
make test make test-performance -
Build and test
make build make docker-build
-
Create release
- Create git tag
- Write release notes
- Upload binaries
- Documentation: Check the
docs/directory - Examples: Look at
examples/directory - Issues: Search existing issues on GitHub
- Discussions: Use GitHub Discussions for questions
Please read and follow our Code of Conduct.
By contributing to FL-GO, you agree that your contributions will be licensed under the same license as the project.