.claude/skills/test-with-gt/SKILL.md
Write Go test code using the gt library. Use when writing tests, creating test files, or when the user asks to add tests for Go code.
npx skillsauth add secmon-lab/warren test-with-gtInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When writing Go test code, use the gt library for type-safe assertions.
First, find where gt is installed and read its documentation:
GT_DIR=$(go list -m -f '{{.Dir}}' github.com/m-mizutani/gt 2>/dev/null)
If gt is available, read the relevant documentation from $GT_DIR/docs/:
docs/README.md - Overview and quick referencedocs/types/*.md - Detailed documentation for each test typedocs/patterns/*.md - Common patterns (method chaining, Required, Describe)| Data Type | Use | NOT |
|-----------|-----|-----|
| []T (slice) | gt.Array(t, arr).Length(3) | gt.Value(t, len(arr)).Equal(3) |
| string | gt.String(t, s).Contains("x") | gt.Bool(t, strings.Contains(s, "x")).True() |
| error | gt.NoError(t, err) | gt.Value(t, err).Nil() |
| int, float, etc. | gt.Number(t, n).Greater(5) | gt.Bool(t, n > 5).True() |
| map[K]V | gt.Map(t, m).HasKey("k") | manual check with gt.Bool |
| bool | gt.Bool(t, b).True() | gt.Value(t, b).Equal(true) |
Required() for fail-fastgt.NoError(t, err).Required() // Stop immediately if error
gt.Value(t, result).NotNil().Required() // Stop if nil
Describef() for contextgt.Array(t, users).
Describef("Users for tenant %s", tenantID).
Length(5)
result := gt.R1(parseJSON(input)).NoError(t)
gt.String(t, result.Name).Equal("Alice")
Constructors: gt.Value, gt.Array, gt.Map, gt.Number, gt.String, gt.Bool, gt.Error, gt.NoError, gt.File, gt.Cast, gt.R1/R2/R3
Short aliases: gt.V, gt.A, gt.M, gt.N, gt.S, gt.B, gt.F, gt.C
development
Write Go error handling code using the goerr library. Use when creating errors, wrapping errors, adding context, or handling errors in Go code that uses goerr.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.