Skip to content
Documentation

Documentation

Wire is a code generation tool for dependency injection in Go, originally built at Google. This repository, wireinject/wire, is the community-maintained fork that took over after google/wire went unmaintained.

The idea in one sentence: you declare which provider functions can build which types, and Wire works out the call order for you, writing the result to wire_gen.go.

Where to start

Installing

go install github.com/wireinject/wire/cmd/wire@latest

Make sure $GOPATH/bin is on your $PATH, then run wire in the package directory you want to generate for.

Project status

As of v0.3.0 Wire is beta and considered feature complete. It works well for the tasks it was designed to perform, and we prefer to keep it as simple as possible: no new features, but bug reports and fixes are welcome.

This is the community-maintained fork; the original project is google/wire.