用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/G1Joshi/Agent-Skills --skill go-test命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| 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.