Thank you for your interest in contributing to sio! This document provides guidelines and instructions for contributing.
Be respectful and professional in all interactions. We're here to build great software together.
- Go 1.24 or later
- Git
- golangci-lint (for linting)
- Basic understanding of cryptography (helpful but not required)
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/sio.git cd sio - Add the upstream repository:
git remote add upstream https://github.com/minio/sio.git
- Install dependencies:
go mod download
git checkout -b feature/your-feature-nameUse prefixes:
feature/- New featuresfix/- Bug fixesdocs/- Documentation changesperf/- Performance improvementsrefactor/- Code refactoring
Follow the coding standards below and ensure your code:
- Is well-tested
- Includes documentation
- Passes all existing tests
- Doesn't introduce security vulnerabilities
# Run all tests
go test -v ./...
# Run with race detector
go test -race ./...
# Run with coverage
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out# Run gofmt
gofmt -s -w .
# Run go vet
go vet ./...
# Run golangci-lint
golangci-lint runWrite clear commit messages following this format:
Short summary (50 chars or less)
More detailed explanation if needed. Wrap at 72 characters.
Explain the problem this commit solves and why you chose
this solution.
Fixes #123
git push origin feature/your-feature-nameThen create a pull request on GitHub with:
- Clear description of the changes
- Reference to related issues
- Screenshots/examples if applicable
- Follow Effective Go
- Use
gofmtfor formatting - Keep functions small and focused
- Write self-documenting code with clear names
- Always check errors
- Wrap errors with context using
fmt.Errorf("context: %w", err) - Return errors, don't panic (except for truly unrecoverable situations)
- Use typed errors for API boundaries
- Write table-driven tests where appropriate
- Test edge cases and error conditions
- Aim for >80% code coverage
- Use meaningful test names:
TestFunctionName_Scenario
- Add godoc comments for all exported types, functions, and constants
- Include usage examples for complex functionality
- Update README.md if adding user-facing features
- Document security considerations
- Never commit secrets or sensitive data
- Be cautious with cryptographic code
- Consider timing attacks and side channels
- Add tests for security-critical code paths
- Update documentation - README.md, godoc comments, etc.
- Add tests - New code must include tests
- Pass CI checks - All tests and linters must pass
- Get reviewed - At least one maintainer must approve
- Squash commits - Keep history clean with meaningful commits
- Tests added/updated and passing
- Documentation updated
- golangci-lint passes
- No breaking changes (or documented in PR)
- Commit messages are clear
- Branch is up to date with master
Focus on:
- Individual function behavior
- Edge cases (empty inputs, max size, etc.)
- Error conditions
- Different cipher suites
Focus on:
- End-to-end encryption/decryption
- Different stream sizes
- Reader/Writer interfaces
- Version compatibility
For cryptographic code, consider adding fuzz tests:
func FuzzDecrypt(f *testing.F) {
// Add corpus and fuzz implementation
}When making performance-related changes:
# Run benchmarks
go test -bench=. -benchmem
# Compare before/after
go test -bench=. -benchmem > old.txt
# make changes
go test -bench=. -benchmem > new.txt
benchstat old.txt new.txt(For maintainers)
- Update version numbers and CHANGELOG
- Run full test suite including race detector
- Tag release:
git tag v1.x.x - Push tag:
git push origin v1.x.x - GitHub Actions will create the release
- Implement the function
- Add godoc comment
- Add unit tests
- Add example test
- Update README if user-facing
- Add a test that reproduces the bug
- Fix the bug
- Verify the test now passes
- Consider adding additional edge case tests
- Add benchmark before changes
- Make improvements
- Run benchmark again
- Include benchmark results in PR
- Verify no functionality regression
- Questions: Open a GitHub Discussion
- Bugs: Open a GitHub Issue
- Security: Email security@min.io
- Chat: Join MinIO Slack (link in README)
Contributors will be:
- Listed in release notes
- Mentioned in commit history
- Added to CONTRIBUTORS file (if significant contribution)
Thank you for contributing to sio!