Go开发模式

Go开发模式 is a skill for Claude Code, Codex from nongjun/awesome-harness-engineering. It costs 42 tokens per session (414 once invoked), scanned A, a copy of Go开发模式, MIT.

A set of guidelines for developing Go software, including backend services, command-line tools, and microservices. It covers project structure, error handling, concurrency, and testing.

In plain words
What is it for?
Use it when writing Go code, Go services or interfaces, goroutines, or Go tests. It also guides package organization and common Go testing patterns.
Why use it?
It helps keep Go code readable and makes errors, background tasks, and tests easier to handle consistently.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/nongjun/awesome-harness-engineering/go
Any agent
npx skills add nongjun/awesome-harness-engineering --skill go
Clone the repo
git clone --depth 1 https://github.com/nongjun/awesome-harness-engineering

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Go开发模式

README.md
[![agentmods](https://agentmods.dev/badge/skills/nongjun/awesome-harness-engineering/go.svg)](https://agentmods.dev/skills/nongjun/awesome-harness-engineering/go)
Your own site
<a href="https://agentmods.dev/skills/nongjun/awesome-harness-engineering/go"><img src="https://agentmods.dev/badge/skills/nongjun/awesome-harness-engineering/go.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 414 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.00414
Opus 5 $0.00021 $0.00207
Sonnet 5 $0.00008 $0.00083
Haiku 4.5 $0.00004 $0.00041

Measured 5d ago against content hash 32d4dc293634, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

Go开发模式 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to Go开发模式 — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/Go开发模式/SKILL.md · 47 lines

What it actually says

Go 开发模式

适用场景

使用 Go 语言开发后端服务、CLI 工具、微服务时。

核心原则

  • 显式优于隐式——Go 不鼓励魔法,代码应该直白可读
  • 错误是值——每个可能出错的地方都显式处理错误,不要忽略
  • 接口小而精——接口只定义必需的方法,一个方法的接口最好
  • 组合优于继承——用结构体嵌入和接口组合,不要模拟类继承
  • 并发用 goroutine + channel——但不要过度并发,简单任务用同步就好

项目结构

Go 项目推荐按功能/领域组织,而非按层级:

  • cmd/ 放入口文件
  • internal/ 放不对外暴露的逻辑
  • pkg/ 放可复用的公共包
  • 每个包职责单一,包名就是它做什么

错误处理

  • 返回 error 而非 panic
  • 用 fmt.Errorf 包装错误添加上下文
  • 在调用方处理错误,不在被调用方静默吞掉
  • 对外 API 返回统一的错误结构

并发模式

  • 用 context 控制 goroutine 生命周期
  • 用 sync.WaitGroup 等待多个 goroutine 完成
  • channel 用于通信,mutex 用于保护共享状态
  • 总是处理 channel 的关闭和超时

测试

  • 表驱动测试(Table-Driven Tests)是标准模式
  • 用 testify 做断言
  • 测试文件和被测文件同目录,以 _test.go 结尾
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 47 lines · 42 tokens per session scan A 32d4dc293634

Subscribe to this mod's changes

Go开发模式 is a skill published in the GitHub repository nongjun/awesome-harness-engineering (2 stars, last pushed 5mo ago), licensed MIT. It adds 42 tokens to every session and 414 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to Go开发模式, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

golang-testing

Go testing best practices including table-driven tests, test helpers, benchmarking, race detection, coverage analysis, and integration testing patterns. Use when writing or improving Go tests.

affaan-m/ECC · 37 tokens

golang-patterns

Go-specific design patterns and best practices including functional options, small interfaces, dependency injection, concurrency patterns, error handling, and package organization. Use when working with Go code to apply idiomatic Go patterns.

affaan-m/ECC · 45 tokens

ast-grep

Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for…

JanDeDobbeleer/oh-my-posh · 80 tokens

gen-test

Generate idiomatic tests for Go packages and handlers in the Meshery project.

meshery/meshery · 18 tokens

golang-testing

Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI…

samber/cc-skills-golang · 115 tokens

golang-uber-fx

Golang application framework using uber-go/fx — fx.New, fx.Provide, fx.Invoke, fx.Module, fx.Lifecycle hooks, fx.Annotate (name/group/As), fx.Decorate, fx.Supply, fx.Replace, fx.WithLogger, and signal-aware Run(). Apply when using or adopting uber-go/fx, when the codebase imports go.uber.org/fx, or when wiring…

samber/cc-skills-golang · 122 tokens