golang-structs-interfaces
CommunityDesign Go types with interfaces and structs.
Software Engineering#interfaces#golang#design-patterns#embedding#dependency-injection#structs#type-assertion
Authorsamber
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Designing Go types can be challenging when balancing small interfaces, embedding decisions, and clear contracts. This Skill provides guidance on when to use interfaces, how to compose types, and how to apply DI patterns for testable code.
Core Features & Use Cases
- Principles for minimal interfaces (1-3 methods) and define them where consumed.
- Strategies for embedding vs named fields, and pointer vs value receivers.
- Dependency injection via interfaces and compile-time interface checks.
- Use with common patterns like type assertions and type switches to keep code safe and expressive.
Quick Start
Describe a minimal Go example with a consumer interface, a struct that depends on it, and a concrete implementation.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: golang-structs-interfaces Download link: https://github.com/samber/cc-skills-golang/archive/main.zip#golang-structs-interfaces Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.