CLAUDE.md@by-language/go claudeA
CLAUDE.md@by-language/go is agent-read markdown (claude) from overseastelegramaliterateperson865/awesome-claude-md.
Indexed from public GitHub and served as immutable, content-addressed versions. Install it pinned to an exact SHA-256 with the mdr CLI, and every file is verified against the hash recorded here before it reaches your agent. The deterministic audit below grades the latest version, and the same file always earns the same grade.
What the file says
# CLAUDE.md - Go 项目规范
## 构建与运行
- 使用 Go Modules 管理依赖,执行 `go mod tidy` 保持 go.sum 干净
- 构建命令:`go build ./cmd/...`,测试命令:`go test ./... -race -count=1`
- Lint 检查:`golangci-lint run`,确保零警告
## 项目结构
- `cmd/` - 各可执行文件入口,每个子目录包含一个 `main.go`
- `internal/` - 私有业务逻辑,禁止被外部项目引用
- `pkg/` - 可被外部引用的公共库代码
- `api/` - Protobuf/OpenAPI 定义文件
- `configs/` - 配置文件模板(不提交实际密钥)
## 错误处理
- 禁止在库代码中使用 `panic`,仅在 `main` 初始化阶段允许 `log.Fatal`
- 使用 `fmt.Errorf("操作描述: %w", err)` 包装错误,保留错误链
- 自定义错误类型实现 `Error()` 接口,必要时实现 `Unwrap()`
- 在调用方统一处理错误,避免重复日志记录
## 接口设计
- 接口定义在消费者侧,而非实现侧(Accept interfaces, return structs)
- 接口保持小而聚焦,优先单方法接口(如 `io.Reader`)
- 使用接口做依赖注入,便于 mock 测试
## 测试规范
- 单元测试文件与源码同目录,命名 `xxx_test.go`
- 使用 `testify/assert` 和 `testify/require` 简化断言
- Table-driven tests 处理多场景,子测试用 `t.Run("场景名", ...)`
- 集成测试加 `//go:build integration` 标签,CI 中单独运行
- Mock 使用 `testify/mock` 或 `gomock`,接口定义处生成
## 代码风格
- 严格遵循 `gofmt` 格式化,提交前执行 `goimports`
- 导出函数和类型必须有 GoDoc 注释,以函数名开头
- Context 作为函数第一个参数传递,命名为 `ctx`
- 不使用 `init()` 函数,显式初始化优于隐式
- Channel 和 Goroutine 必须有明确的退出机制,防止泄漏
## 常见陷阱
- 向 nil map 写入会 panic,使用前必须 `make(map[K]V)` 初始化
- 无缓冲 channel 在 goroutine 中发送但无接收方会导致 goroutine 永久泄漏
…Read the whole file at its exact version.
How to install
mdr add overseastelegramaliterateperson865/awesome-claude-md/by-language/go/CLAUDE.md@git:20260320.9b01acamdr add overseastelegramaliterateperson865/awesome-claude-md/by-language/go/CLAUDE.md@sha256:841f9dbd3828c5d7Pin to a label to follow the author's releases, or to a sha256 to freeze the exact bytes forever. Either way the resolved hash is written to mdr.lock, and mdr install reproduces it on any machine.
[](https://markdownregistry.com/a/art_wacc2mlni2wwvxa4)
1 badge views in 30 days
Versions
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20260320.9b01aca latest | 2026-03-20 | 9b01aca | 2,326 B | A | view · diff |
| git:20260320.fcf2609 | 2026-03-20 | fcf2609 | 1,819 B | A | view |
Audit of the latest version
- pass: Size between 200 bytes and 200 KB (2326 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
overseastelegramaliterateperson865/awesome-claude-md · 3 stars · license MIT · pushed 2026-09-23 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_wacc2mlni2wwvxa4 GET https://markdownregistry.com/api/v1/resolve?ref=overseastelegramaliterateperson865/awesome-claude-md/by-language/go/CLAUDE.md GET https://markdownregistry.com/api/v1/blob/841f9dbd3828c5d7e36d8132f6f026780a4119e90c5c847dd9bfdb2068d8a268
Your agent does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
More from overseastelegramaliterateperson865/awesome-claude-md
Every file in overseastelegramaliterateperson865/awesome-claude-md