Contributing
Development Setup
Section titled “Development Setup”Requirements: Go 1.26+
git clone https://github.com/LarsArtmann/go-error-family.gitcd go-error-familygo mod downloadBuilding
Section titled “Building”go build ./...Testing
Section titled “Testing”# All tests (root + submodules) with race detectiongo test ./... -count=1 -timeout 120s -raceLinting
Section titled “Linting”Uses golangci-lint with strict defaults. Configuration lives in .golangci.yml.
golangci-lint run ./...Code Style
Section titled “Code Style”- Standard
testingpackage — no testify or other test utilities t.Parallel()on most tests- Early returns over nested conditionals
- Strong types over runtime checks
- No one-letter variable names
- Consumer interfaces embed
error(required for Go 1.26’serrors.AsType[T]()) - Template placeholders use
{key}syntax (not{{.key}})
Architecture: Libraries Classify, Applications Enrich
Section titled “Architecture: Libraries Classify, Applications Enrich”go-error-family (classification) and samber/oops (enrichment) are complementary:
- Library code imports go-error-family only — returns classified errors
- Application code imports oops for enrichment and wraps via the
bridge/package
The four interfaces (Coded/Classified/Contextual/Retryable) are the sole public contract.
Pull Requests
Section titled “Pull Requests”- Ensure all tests pass:
go test ./... -count=1 -timeout 120s -race - Ensure linting passes:
golangci-lint run ./... - Add tests for new functionality
- Keep changes focused and atomic
- Do not add third-party dependencies to the root module (it must stay zero-dependency)