skills/smithery.ai/accept-interfaces-return-structs

accept-interfaces-return-structs

Installation
SKILL.md

Accept Interfaces, Return Structs

The fundamental Go interface design principle: functions should accept interfaces but return concrete types.

The Pattern

CORRECT - Accept interface, return concrete

type Storage interface {
    Save(data []byte) error
}

func NewProcessor(s Storage) *Processor {
    return &Processor{storage: s}
}
Installs
1
First Seen
Mar 22, 2026
accept-interfaces-return-structs from smithery.ai