Skip to main content
在 Manus 中运行任何 Skill
一键导入

golang-patterns

星标2
分支0
更新时间2026年7月9日 00:38

Idiomatic Go engineering discipline: writing, reviewing, and refactoring Go so it stays boring, predictable, and easy to maintain. Covers the core Go proverbs (clear over clever, accept interfaces return structs, useful zero values), error-handling contracts (wrap with %w, sentinel + typed errors, errors.Is / errors.As, never silently drop), concurrency safety (worker pools, context-driven cancellation and timeout, errgroup, goroutine-leak avoidance, graceful shutdown), interface and package design (small consumer-side interfaces, no package-level mutable state, dependency injection), struct ergonomics (functional options, embedding), allocation-aware performance (preallocation, strings.Builder, sync.Pool), and the standard tooling gate (go vet, staticcheck, golangci-lint, race detector, gofmt/goimports). Use when authoring a new .go file, reviewing a Go pull request, designing a package or module boundary, wiring goroutines and channels, shaping an error path, or picking a lint gate.

安装

用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。

SKILL.md
readonly