Automated Initialization
in Go
Wire is a code generation tool that connects components using dependency
injection. Dependencies are ordinary function parameters — no runtime
state, no reflection.
Explicit initialization
Every dependency shows up in a function signature, so the object graph is visible at compile time. No global variables, no reflection.
Generated code is plain Go
Nothing depends on Wire at runtime. The output looks like hand-written initialization, and stays useful even if you stop using the tool.
Mistakes caught early
Missing providers, duplicate bindings, dependency cycles — all reported at generation time, with the file, line and injector that caused them.
Provider sets
Bundle related providers into reusable sets, with interface bindings, value bindings and struct field extraction.
A CLI that does more than generate
gen writes code, check validates wiring, diff proves the output is current, show describes sets, graph draws the dependency diagram.
Cleanup functions
A provider can return a cleanup closure. The injector aggregates them and unwinds already-created resources when a later provider fails.