Contributing
Development Setup
Section titled “Development Setup”Requirements: Go 1.26+, Nix (optional but recommended)
git clone https://github.com/larsartmann/go-branded-id.gitcd go-branded-idIf using Nix:
nix develop # enters dev shell with Go, golangci-lint, goplsBuilding
Section titled “Building”GOEXPERIMENT=jsonv2 go build ./...Or via Nix:
nix run .#buildTesting
Section titled “Testing”# Run all testsGOEXPERIMENT=jsonv2 go test ./... -count=1
# With race detectorGOEXPERIMENT=jsonv2 go test ./... -race -count=1
# Or via Nixnix run .#testnix run .#test-raceAll tests use t.Parallel() and the standard testing package.
Linting
Section titled “Linting”Uses golangci-lint v2 with an extremely strict config (.golangci.yml):
GOEXPERIMENT=jsonv2 golangci-lint run
# Or via Nixnix run .#lintCode Style
Section titled “Code Style”gofumpt(stricter thangofmt) +goimports+golines(120 chars)t.Parallel()on all tests- Generic test helpers:
test<Name>orassert<Cmp><Action> nolintcomments with justification rationale are expected- Single-letter variables trigger
varnamelen— use full words
All pull requests must pass:
go build ./...— compiles cleanlygo test -race ./...— tests pass with race detectiongo vet ./...— no vet warningsgolangci-lint run ./...— no lint issues
Pull Requests
Section titled “Pull Requests”- Ensure all tests pass with
GOEXPERIMENT=jsonv2set - Ensure linting passes
- Add tests for new functionality
- Keep changes focused and atomic
- Consider the 14 downstream repos in the ecosystem when making breaking changes