test-golisted
Install: claude install-skill sergeyklay/.agents
# Go Testing
## Placeholders
Examples below use two placeholders. They are not literal - substitute the actual names from the project being worked on, matching the case of the surrounding context:
- `{PROJECT}` - the project's identifier (e.g. env-var prefix, repo name). In env vars: `MYAPP_…`. In prose: `MyApp` or `myapp`.
- `{integration}` - an external system or adapter name (e.g. `jira`, `stripe`, `claude`). In paths: `internal/tracker/jira/`. In env vars: `JIRA_…`. In type names: `JiraAdapter`.
`.go` files in `assets/` use concrete-looking sample names (`Adapter`, `MYAPP_INTEGRATION_TEST`, etc.) so the templates stay syntactically valid Go; comments inside each template tell you what to rename.
## Decision Framework
Before writing any test, determine which category it belongs to:
| Category | Characteristics | Run condition |
| ---------------------- | -------------------------------------------------- | ------------------------------------------------------- |
| **Unit** | Deterministic, no I/O, no network | Always (`make test`) |
| **Unit with fixtures** | Reads `testdata/` files, uses `t.TempDir()` | Always |
| **Unit with httptest** | Spins up `httptest.NewServer`, tests HTTP adapters | Always |
| **Int