go
Go language conventions, patterns, and tooling. This skill should be used when working with Go source files (.go), go.mod, or building Go CLI programs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Go language conventions, patterns, and tooling. This skill should be used when working with Go source files (.go), go.mod, or building Go CLI programs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Step-by-step teaching mode for implementation guidance. Use when the user asks Codex to teach them how to implement a change themselves, says "use instruct", "teach me step by step", "walk me through implementing", "show me incrementally", or otherwise wants guidance-first coding help instead of Codex directly editing files.
Guidance for designing, writing, reviewing, or refactoring tests in this project. Use when adding tests for features or bugs, deciding unit vs integration boundaries, choosing what to mock, improving test structure, or reducing brittle/slow/flaky tests.
Turn a rough idea into a reviewed design spec before any implementation.
Debug issues using a structured, evidence-first process.
Execute a written implementation plan in this session with checkpoints.
Execute a written implementation plan task-by-task using pi subagents with review gates.
| name | go |
| description | Go language conventions, patterns, and tooling. This skill should be used when working with Go source files (.go), go.mod, or building Go CLI programs. |
go fmtgo vetany instead of interface{}.maps.Copy, maps.Clone, maps.Keys, maps.Values instead of manual map iteration.slices.Contains, slices.Sort, slices.Clone, slices.Concat instead of hand-rolled equivalents.min() / max() builtins (Go 1.21+) instead of custom helpers.cmp.Or (Go 1.22+) for first-non-zero-value selection.map[T]struct{} not map[T]bool when writing setsUse Go's slog package for structured logging. Do not use log for application logging.
For simple single-purpose tools without subcommands, use a minimal main() that delegates to run():
package main
import (
"log"
"os"
)
func main() {
if err := run(); err != nil {
log.Fatal(err)
}
os.Exit(0)
}
func run() error {
// actual program logic here
return nil
}
Add arguments to run() (like context.Context) only when actually needed.
For programs with subcommands, flags, or any non-trivial CLI interface, use cobra.