‹ 首页

lang-go

@dragoscirjan · 收录于 1 周前 · 上游提交 1 个月前

Go development standards, Effective Go, and tooling.

适合你,如果正在用 Go 写项目并想遵循最佳实践

/ 通过 npx 安装 校验哈希
npx oh-my-skill add dragoscirjan/opencode-config/lang-go
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- dragoscirjan/opencode-config/lang-go
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify dragoscirjan/opencode-config/lang-go
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
0GitHub stars
~154上下文体积 · 单文件
索引托管

怎么用

商店整理自技能原文 · 版本 f561928 · 表述以原文为准
它做什么

Claude 会按照 Go 语言官方风格和 Google Go 风格编写代码,使用 gofmt 格式化,用 golangci-lint 检查,返回错误而非 panic,接口小而精,并发用 goroutine 和 channel,context 作为第一个参数。

什么时候触发

当你要求编写或审查 Go 代码,或询问 Go 开发标准时触发。

装好后可以这样说
Claude 会检查是否显式返回错误并正确包装。
技能原文 SKILL.md作者撰写 · MIT · f561928

GO Standards

  • Style: Effective Go & Google Go Style.
  • Tooling: gofmt / goimports, golangci-lint, testing package + table-driven tests.
  • Errors: Return errors explicitly, never panic. Wrap errors with fmt.Errorf("%w", err).
  • Interfaces: Accept interfaces, return concrete types. Keep interfaces small (1-2 methods).
  • Concurrency: Use goroutines and channels, but avoid sharing memory to communicate; share memory by communicating.
  • Context: Pass context.Context as the first argument for functions doing I/O.

Always load clean-code alongside this skill.

按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。