Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit 9325dc9

Browse files
committed
all: migrate from google/wire to wireinject/wire
1 parent 9c25c90 commit 9325dc9

File tree

8 files changed

+18
-10
lines changed

8 files changed

+18
-10
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ jobs:
2121
os: [ubuntu-latest, macos-latest, windows-latest]
2222
go-version: [1.25.x]
2323
runs-on: ${{ matrix.os }}
24+
env:
25+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2426
steps:
2527
- name: Install Go
26-
uses: actions/setup-go@v2
28+
uses: actions/setup-go@v5
2729
with:
2830
go-version: ${{ matrix.go-version }}
2931
- name: Checkout code
30-
uses: actions/checkout@v2
32+
uses: actions/checkout@v4
3133
with:
3234
fetch-depth: 2 # required for codecov
3335
- name: Run Tests

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
[![godoc](https://godoc.org/github.com/google/wire?status.svg)][godoc]
55

66
> [!WARNING]
7-
> This project is no longer maintained.
7+
> This origin project is no longer maintained.
88
>
9-
> If you wish to update or extend wire, please do so in a fork.
9+
> This is a version maintained by wireinject/wire.
1010
1111
Wire is a code generation tool that automates connecting components using
1212
[dependency injection][]. Dependencies between components are represented in
@@ -27,7 +27,7 @@ For an overview, see the [introductory blog post][].
2727
Install Wire by running:
2828

2929
```shell
30-
go install github.com/google/wire/cmd/wire@latest
30+
go install github.com/wireinject/wire/cmd/wire@latest
3131
```
3232

3333
and ensuring that `$GOPATH/bin` is added to your `$PATH`.

cmd/wire/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ import (
3232
"strings"
3333

3434
"github.com/google/subcommands"
35-
"github.com/google/wire/internal/wire"
3635
"github.com/pmezard/go-difflib/difflib"
36+
"github.com/wireinject/wire/internal/wire"
3737
"golang.org/x/tools/go/types/typeutil"
3838
)
3939

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/google/wire
1+
module github.com/wireinject/wire
22

33
go 1.19
44

internal/alldeps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
github.com/google/subcommands
2-
github.com/google/wire
32
github.com/pmezard/go-difflib
3+
github.com/wireinject/wire
44
golang.org/x/mod
55
golang.org/x/sync
66
golang.org/x/tools

internal/wire/parse.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,13 +1133,18 @@ func findInjectorBuild(info *types.Info, fn *ast.FuncDecl) (*ast.CallExpr, error
11331133
return wireBuildCall, nil
11341134
}
11351135

1136+
var wireImportPaths = map[string]bool{
1137+
"github.com/google/wire": true,
1138+
"github.com/wireinject/wire": true,
1139+
}
1140+
11361141
func isWireImport(path string) bool {
11371142
// TODO(light): This is depending on details of the current loader.
11381143
const vendorPart = "vendor/"
11391144
if i := strings.LastIndex(path, vendorPart); i != -1 && (i == 0 || path[i-1] == '/') {
11401145
path = path[i+len(vendorPart):]
11411146
}
1142-
return path == "github.com/google/wire"
1147+
return wireImportPaths[path]
11431148
}
11441149

11451150
func isProviderSetType(t types.Type) bool {

internal/wire/wire.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ func (g *gen) frame(tags string) []byte {
267267
tags = fmt.Sprintf(" gen -tags \"%s\"", tags)
268268
}
269269
buf.WriteString("// Code generated by Wire. DO NOT EDIT.\n\n")
270-
buf.WriteString("//go:generate go run -mod=mod github.com/google/wire/cmd/wire" + tags + "\n")
270+
buf.WriteString("//go:generate go run -mod=mod github.com/wireinject/wire/cmd/wire" + tags + "\n")
271271
buf.WriteString("//+build !wireinject\n\n")
272272
buf.WriteString("package ")
273273
buf.WriteString(g.pkg.Name)

internal/wire/wire_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ func loadTestCase(root string, wireGoSrc []byte) (*testCase, error) {
520520
if err != nil {
521521
return nil, fmt.Errorf("load test case %s: %v", name, err)
522522
}
523+
wantWireOutput = []byte(strings.Replace(string(wantWireOutput), "//go:generate go run -mod=mod github.com/google/wire/cmd/wire", "//go:generate go run -mod=mod github.com/wireinject/wire/cmd/wire", 1))
523524
return &testCase{
524525
name: name,
525526
pkg: string(bytes.TrimSpace(pkg)),

0 commit comments

Comments
 (0)