Thanks for helping build the SDK. This document covers the essentials; the full,
enforced rule set lives in CLAUDE.md and the dexpace
Go styleguide.
- Target Go 1.26+ and prefer modern idioms (generics, range-over-func
iterators,
log/slog,math/rand/v2,min/max). - No third-party runtime dependencies. Non-test code imports only the standard library. If you need an external library, hide it behind an interface and keep it in tests or a future adapter package.
- Lean on
net/http. Do not reinvent request/response/header models or add an I/O abstraction layer. - Every
.gofile starts with the MIT license header (see any existing file) and belongs to a package with a doc comment.
Run the full local gate:
make check # go mod tidy + gofumpt + go vet + golangci-lint + go test -raceor individually:
go test -race -covermode=atomic ./...
go vet ./...
golangci-lint run
gofumpt -l . # should print nothingCI (.github/workflows/ci.yml) runs the same checks on Go 1.26 and fails on any
diff from go mod tidy, any vet/lint finding, or any test failure.
- Table-driven where it helps; call
t.Parallel()in every test. - Close response bodies with
t.Cleanup(func() { _ = resp.Body.Close() }). - Use local fakes (a
transporterFunc, a stubTokenCredential) — no mocking frameworks. - Add an
Examplefor user-facing API where it aids the docs.
Conventional prefixes, imperative subject ≤ 72 chars:
feat: add SSE event reader
fix: rewind body before each retry attempt
docs: document pipeline ordering
test: cover Retry-After parsing
chore: bump golangci-lint config
No Co-Authored-By trailers; commits author as the repository owner.