Skip to content

Contributing

Requirements: Go 1.26+

Terminal window
git clone https://github.com/LarsArtmann/go-error-family.git
cd go-error-family
go mod download
Terminal window
go build ./...
Terminal window
# All tests (root + submodules) with race detection
go test ./... -count=1 -timeout 120s -race

Uses golangci-lint with strict defaults. Configuration lives in .golangci.yml.

Terminal window
golangci-lint run ./...
  • Standard testing package — 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’s errors.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.

  • 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)