Best use case
go-test is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Go testing package. Use for Go testing.
Teams using go-test should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/go-test/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How go-test Compares
| Feature / Agent | go-test | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Go testing package. Use for Go testing.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Go Test
Go has a built-in testing framework in the `testing` package. It follows Go's effective, minimalist philosophy: no magic, just code.
## When to Use
- **Go Projects**: It is the standard. No 3rd party runner needed.
- **Benchmarks**: Built-in support (`func BenchmarkXxx(b *testing.B)`).
## Quick Start
```go
// main_test.go
package main
import "testing"
func TestAdd(t *testing.T) {
got := Add(1, 2)
want := 3
if got != want {
t.Errorf("Add(1, 2) = %d; want %d", got, want)
}
}
```
Run with `go test ./...`.
## Core Concepts
### Table Driven Tests
The idiomatic way to write Go tests. Define a slice of structs with input/output, then loop range over them.
```go
tests := []struct {
input int
want int
}{
{1, 2},
{2, 4},
}
for _, tc := range tests {
t.Run("subtest", func(t *testing.T) { ... })
}
```
### Subtests (`t.Run`)
Allows hierarchical test execution and reporting.
### Helper Functions
Use `t.Helper()` in utility functions so that failure logs point to the test caller, not the helper line.
## Best Practices (2025)
**Do**:
- **Use `testify/assert`**: If you hate `if got != want`, use the `testify` library for `assert.Equal(t, want, got)`. It's the most accepted "lib" extension.
- **Run with `-race`**: `go test -race ./...` to detect race conditions.
- **Parallelism**: Use `t.Parallel()` inside tests to speed up execution.
**Don't**:
- **Don't use assertions for everything**: Go prefers explicit error checking.
- **Don't ignore errors**: If a setup step fails, use `t.Fatal` to stop the test immediately.
## References
- [Go Testing Package](https://pkg.go.dev/testing)Related Skills
vitest
Vitest fast Vite-native testing. Use for Vite projects.
testng
TestNG Java testing framework. Use for Java testing.
testing-library
Testing Library user-centric testing. Use for React testing.
pytest
pytest Python testing framework with fixtures. Use for Python testing.
cargo-test
Cargo test for Rust testing. Use for Rust testing.
template
Expert [skill-name] assistance covering [feature 1], [feature 2], and [feature 3]. Use when [working with X], [debugging Y], or [implementing Z].
zsh
Zsh shell with oh-my-zsh. Use for terminal shell.
zed
Zed high-performance collaborative editor. Use for fast editing.
xcode
Xcode Apple development IDE with simulators. Use for iOS/macOS development.
webstorm
WebStorm JavaScript IDE with debugging. Use for web development.
webpack
Webpack module bundler with loaders and plugins. Use for bundling.
warp
Warp modern terminal with AI. Use for terminal work.