# go-stdlib Idiomatic Go 1.22+ rules: stdlib net/http with mux, error wrapping, context discipline, no framework lock-in. ```bash npx rulepack add go-stdlib ``` ## What it covers - HTTP with the standard library: `http.ServeMux` and method-aware patterns (`mux.HandleFunc("GET /users/{id}", h)`) — no gin/echo/chi without a hard requirement - Error wrapping via `fmt.Errorf("...: %w", err)` so callers can `errors.Is` / `errors.As`, with package-level sentinel errors and typed errors that `Unwrap()` - Context discipline: `context.Context` as the first param of any blocking call, never stored in a struct, with a clear goroutine shutdown path - Concurrency with `errgroup.Group` for fan-out plus first-error semantics; no fire-and-forget goroutines - JSON via `encoding/json` with explicit struct tags, plus `gofmt -s`, `goimports`, `go vet`, and `staticcheck` cleanliness ## Source Rules align with the Go standard library & official documentation: https://pkg.go.dev/std ## License MIT