LabscoMCP early access ↗

How to shape the types a Go program is built from — several small interfaces rather than one big one, when to embed a type instead of holding it, and pointer or value on a method.

WHEN TO USE

SCOPE

USE FOR

  • Design a Go interface with one to three methods instead of one large contract.
  • Decide whether a function should accept an interface and return a concrete type.
  • Choose between embedding a type and holding it as a named field.
  • Add a compile-time check that a type still satisfies an interface.
  • Tag struct fields so JSON, YAML, or database serialization survives a rename.
  • Decide whether a method needs a pointer receiver or a value receiver.