go-interfaces

Installation
SKILL.md

Go Interfaces and Composition

Available Scripts

  • scripts/check-interface-compliance.sh — Finds exported interfaces missing compile-time compliance checks (var _ I = (*T)(nil)). Run bash scripts/check-interface-compliance.sh --help for options.

Accept Interfaces, Return Concrete Types

Interfaces belong in the package that consumes values, not the package that implements them. Return concrete (usually pointer or struct) types from constructors so new methods can be added without refactoring.

// Good: consumer defines the interface it needs
package consumer

type Thinger interface { Thing() bool }
Related skills

More from cxuu/golang-skills

Installs
551
GitHub Stars
91
First Seen
Jan 27, 2026