with one click
go-test
Go testing package. Use for Go testing.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Go testing package. Use for Go testing.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Android Studio IDE with emulator and profiler. Use for Android development.
Atom hackable text editor from GitHub. Use for extensible editing.
Babel JavaScript compiler for compatibility. Use for transpiling.
Biome fast formatter and linter. Use for code quality.
Bitbucket Git repository hosting with Pipelines. Use for Atlassian teams.
Confluence team documentation platform. Use for documentation.
| name | go-test |
| description | Go testing package. Use for Go testing. |
Go has a built-in testing framework in the testing package. It follows Go's effective, minimalist philosophy: no magic, just code.
func BenchmarkXxx(b *testing.B)).// 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 ./....
The idiomatic way to write Go tests. Define a slice of structs with input/output, then loop range over them.
tests := []struct {
input int
want int
}{
{1, 2},
{2, 4},
}
for _, tc := range tests {
t.Run("subtest", func(t *testing.T) { ... })
}
t.Run)Allows hierarchical test execution and reporting.
Use t.Helper() in utility functions so that failure logs point to the test caller, not the helper line.
Do:
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.-race: go test -race ./... to detect race conditions.t.Parallel() inside tests to speed up execution.Don't:
t.Fatal to stop the test immediately.