golang-structs-interfaces
Golang struct and interface design patterns — composition, embedding, type assertions, type switches, interface segregation, dependency injection via interfaces, struct field tags, and pointer vs value receivers. Use this skill when designing Go types, defining or implementing interfaces, embedding structs or interfaces, writing type assertions or type switches, adding struct field tags for JSON/YAML/DB…
- installs 8w
- 4,258
- 30-day movement
- starts with the next reading
- Related entries
- 1
- Connections
- 1
An agent skill (SKILL.md) that encodes Go struct and interface design patterns: interface segregation, embedding, type assertions and switches, field tags, dependency injection, and pointer vs value receivers. It bundles reference files on struct fields and type assertions and includes a pitfalls section.
Reach for it when an AI coding agent needs opinionated, idiomatic guidance while designing Go types or interfaces.
Use it to
- Design small, consumer-defined interfaces
- Choose between pointer and value receivers
- Write comma-ok type assertions and type switches
- Add JSON/YAML/DB struct field tags
- Apply dependency injection via interfaces
For Go developers using Claude Code, Codex, or similar agents
- Host repository
- samber/cc-skills-golang
- Version
- 1.2.1
- Installs, lifetime
- 38k
- Installs, 8 weeks
- 4,258
- Allowed tools
- Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent AskUserQuestion
- Compatible with
- Designed for Claude Code, Codex or similar harness, and for projects using Golang.
- Licence
- MIT
- Invocable by
- user
- Host stars
- 3,292
- Host language
- Go