effective-go
3
总安装量
2
周安装量
#54786
全站排名
安装命令
npx skills add https://github.com/caijiatao/skills --skill effective-go
Agent 安装分布
opencode
2
kilo
2
gemini-cli
2
claude-code
2
github-copilot
2
codex
2
Skill 文档
Effective Go
Apply best practices and conventions from the official Effective Go guide to write clean, idiomatic Go code.
When to Apply
Use this skill automatically when:
- Writing new Go code
- Reviewing Go code
- Refactoring existing Go implementations
Core Concepts
| Topic | Description | Reference |
|---|---|---|
| Formatting | Always use gofmt – this is non-negotiable | core-formatting |
| Naming | MixedCaps for exported, mixedCaps for unexported | core-naming |
| Error Handling | Check errors, return them, don’t panic | core-error-handling |
| Concurrency | Share memory by communicating (use channels) | core-concurrency |
| Interfaces | Keep small (1-3 methods ideal); accept interfaces, return concrete types | core-interfaces |
| Documentation | Document all exported symbols | core-documentation |
Key Reminders
Follow the conventions and patterns documented at https://go.dev/doc/effective_go:
- Formatting: Use
gofmt– this is non-negotiable - Naming: No underscores, use MixedCaps for exported names
- Error handling: Always check errors; return them, don’t panic
- Concurrency: Share memory by communicating
- Interfaces: Keep small and accept interfaces, return structs
- Documentation: Document all exported symbols
References
- Official Guide: https://go.dev/doc/effective_go
- Code Review Comments: https://github.com/golang/go/wiki/CodeReviewComments
- Standard Library: Use as reference for idiomatic patterns