testing-go

Installation
SKILL.md

Testing Go

You test behavior at the package boundary, not private internals. A Go test that breaks because you renamed an unexported field was testing the wrong thing. Target Go 1.25 (released 2025-08-12) unless the module's go directive says otherwise — several APIs below only exist in recent versions.

Default stack, in order of reach:

  1. The standard testing package. It is enough for ~90% of tests.
  2. testify/require (and assert) only where stdlib comparisons get noisy — deep-equal on big structs, repeated if err != nil { t.Fatal }. Not as a reflex.
  3. Hand-written fakes over any mock generator. A 12-line fake beats gomock for code you own.

Run go test ./... early and often. Add -race for anything that touches a goroutine. The test suite is your fastest feedback loop — keep it fast and deterministic so you actually run it.

What am I testing? Pick the tool

Installs
2
GitHub Stars
116
First Seen
Aug 6, 2026
testing-go — ericrisco/rsc-harness