Skip to content
@wireinject

wireinject

Compile-time Dependency Injection for Go

wireinject

Good news! The google/wire project has been unarchived and is now receiving updates again."

Bad news: On August 25, 2025, google/wire was archived again.

wireinject/wire is a community project dedicated to maintaining a runnable version of google/wire.

Motivation

The original google/wire repository has been archived by Google and is no longer maintained. This has led to a critical issue:

With upcoming Go releases (such as Go 1.25), attempting to install wire via go install fails due to an outdated dependency on golang.org/x/tools. The build fails with the following compile error:

x/tools: v0.8.0 through v0.25.0 (Oct 2024) contain public packages that fail to build with Go 1.25.0 #74462

# golang.org/x/tools/internal/tokeninternal
.../go/pkg/mod/golang.org/x/tools@v0.17.0/internal/tokeninternal/tokeninternal.go:78:9: invalid array length -delta * delta (constant -256 of type int64)

This issue breaks CI/CD pipelines for any project that relies on wire for code generation once they upgrade their Go toolchain. To solve this problem, we created wireinject/wire.

Our Goal

The objective of wireinject/wire is very specific and limited:

  • We do not aim to add any new features.
  • Our sole purpose is to update dependencies with the minimum necessary changes to the google/wire source code, ensuring that it compiles and runs correctly on modern Go toolchains.

We are committed to making this fork a stable and reliable drop-in replacement, allowing the community to continue using the wire tool seamlessly.

How to Use

Migrating from the original google/wire is straightforward, and no changes to your project's code are required.

You simply need to replace the wire binary on your system with the version compiled from wireinject/wire.

Installation

Run the following command to install the patched wire tool:

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

After installation, ensure that the wire command in your $PATH points to the newly installed executable. You can verify this using the which wire command.

Compatibility Guarantee

The wire_gen.go file produced by wireinject/wire is identical to the file generated by the original google/wire. Your existing workflows will not be affected in any way.

Pinned Loading

  1. wire wire Public

    Forked from google/wire

    Compile-time Dependency Injection for Go

    Go 11

Repositories

Showing 2 of 2 repositories

Top languages

Loading…

Most used topics

Loading…