LabscoMCP early access ↗

Hand a service the things it needs instead of letting it go and find them itself — how to wire a Go app together by hand, and when the graph has grown enough to be worth a library.

WHEN TO USE

SCOPE

USE FOR

  • Wire a small service by hand with plain constructor injection, no library needed.
  • Pick the right DI library — google/wire, uber-go/dig or fx, or samber/do — for the project's size.
  • Refactor a codebase's global variables and init() service setup toward explicit injection.
  • Mock a dependency at an interface boundary in a unit test instead of hitting a real database.
  • Decide when a growing dependency graph justifies adopting a container over manual wiring.

NOT FOR

  • Not for a specific library's detailed API once you've picked one — see that library's own skill.