LabscoMCP early access ↗

The wire tool writes the code that builds an application's objects in the right order — at compile time, so a missing piece is a build error instead of a crash on the first request.

WHEN TO USE

SCOPE

USE FOR

  • Set up a wireinject injector file and generate its wire_gen.go implementation.
  • Group related providers into a reusable wire.NewSet for a package.
  • Bind an interface to its concrete implementation explicitly with wire.Bind.
  • Disambiguate two providers of the same underlying type with named wrapper types.
  • Chain cleanup functions correctly across a graph of providers that open resources.

NOT FOR

  • Not for runtime, reflection-based dependency injection — that's a different library.
  • Does not provide lifecycle hooks like OnStart/OnStop; fx covers those instead.