# google/wire

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/google-wire).**

14,403 stars · 738 forks · Go · Apache-2.0 · archived

## Links

- GitHub: https://github.com/google/wire
- awesome-repositories: https://awesome-repositories.com/repository/google-wire.md

## Topics

`codegen` `dependency-injection` `go` `golang` `initialization`

## Description

Wire is a compile-time dependency injection framework for Go that generates code to wire application components together. It analyzes function signatures at compile time to build an explicit initialization graph, removing the need for runtime reflection or manual wiring code.

The framework operates as a Go code generator and static analysis tool, transforming annotated source code into generated wire files that compile alongside the original project. It connects dependencies by matching function parameters and return types, producing a directed acyclic graph of component dependencies that is fully resolved before runtime execution.

Wire generates dependency injection code by analyzing function signatures and producing wire-ready Go source files through source-to-source transformation. The generator composes components into a single initialization function, ensuring all dependencies are satisfied without runtime inspection.

## Tags

### Development Tools & Productivity

- [Compile-Time Dependency Resolution](https://awesome-repositories.com/f/development-tools-productivity/compile-time-dependency-resolution.md) — Wires Go application components together at compile time, eliminating runtime reflection and manual initialization code.
- [Static Dependency Resolution](https://awesome-repositories.com/f/development-tools-productivity/dependency-analysis-tools/code-dependency-analysis/static-dependency-resolution.md) — Analyzes Go function signatures and types at compile time to determine the complete dependency graph.
- [Initialization Graph Builders](https://awesome-repositories.com/f/development-tools-productivity/dependency-graph-resolvers/initialization-graph-builders.md) — Builds a directed acyclic graph of component dependencies fully resolved before runtime.

### Software Engineering & Architecture

- [Compile-Time Dependency Injection Frameworks](https://awesome-repositories.com/f/software-engineering-architecture/compile-time-dependency-injection-frameworks.md) — Uses a code generator to compose components into a single initialization function, ensuring all dependencies are satisfied.
- [Automated Component Wiring](https://awesome-repositories.com/f/software-engineering-architecture/automated-component-wiring.md) — Connects components by matching function parameters and return types, eliminating runtime reflection.
- [Compile-Time Code Generation](https://awesome-repositories.com/f/software-engineering-architecture/compile-time-code-generation.md) — Generates dependency injection code at compile time by analyzing Go function signatures.
- [Component Initializers](https://awesome-repositories.com/f/software-engineering-architecture/dependency-tracking/explicit/component-initializers.md) — Connects dependencies through function signatures so initialization is explicit and testable. ([source](https://cdn.jsdelivr.net/gh/google/wire@main/README.md))

### DevOps & Infrastructure

- [Dependency Injection Containers](https://awesome-repositories.com/f/devops-infrastructure/dependency-management/dependency-injection-containers.md) — Creates a container that resolves and injects dependencies based on declared provider and injector functions.
- [Dependency Injection Source Generators](https://awesome-repositories.com/f/devops-infrastructure/dependency-management/dependency-injection-systems/metadata-driven-dependency-injection/dependency-injection-source-generators.md) — Generates compile-time code that wires together components by analyzing function parameters. ([source](https://cdn.jsdelivr.net/gh/google/wire@main/README.md))

### Programming Languages & Runtimes

- [Go Code Generators](https://awesome-repositories.com/f/programming-languages-runtimes/go-code-generators.md) — Produces source code that connects dependencies through explicit function parameters for testable initialization.
- [Go Source-to-Source Transformers](https://awesome-repositories.com/f/programming-languages-runtimes/source-code-compilers/source-code-templates/source-code-transformation-engines/go-source-to-source-transformers.md) — Transforms annotated Go source code into generated wire files compiled alongside the original project.
- [Static Analysis Tools](https://awesome-repositories.com/f/programming-languages-runtimes/language-ecosystems-tooling/programming-environments-tooling/go-environments/static-analysis-tools.md) — Analyzes Go source code to build a dependency graph and generate wiring code without runtime overhead.

### Part of an Awesome List

- [Dependency Injection](https://awesome-repositories.com/f/awesome-lists/devtools/dependency-injection.md) — Compile-time dependency injection.
