Repository: google/wire (go)

Issue:
go get not work with Go 1.17
when i try to install wire with this command:
`go get github.com/google/wire/cmd/wire         `  
i get this error:


go get: installing executables with 'go get' in module mode is deprecated.
        To adjust and download dependencies of the current module, use 'go get -d'.
        To install using requirements of the current module, use 'go install'.
        To install ignoring the current module, use 'go install' with a version,
        like 'go install example.com/cmd@latest'.
        For more information, see https://golang.org/doc/go-get-install-deprecation
        or run 'go help get' or 'go help install'.


base on [this](https://go.dev/doc/go-get-install-deprecation) link, starting in Go 1.17, installing executables with go get is deprecated. go install may be used instead.

Pull request description:
README: fix install instructions on tutorial
Fixes #338 on `_tutorial/README.md`

Patch:
diff --git a/_tutorial/README.md b/_tutorial/README.md
index cfccde1..f39fba2 100644
--- a/_tutorial/README.md
+++ b/_tutorial/README.md
@@ -163,7 +163,7 @@ injector complete, we are ready to use the `wire` command line tool.
 Install the tool with:
 
 ``` shell
-go get github.com/google/wire/cmd/wire
+go install github.com/google/wire/cmd/wire@latest
 ```
 
 Then in the same directory with the above code, simply run `wire`. Wire will
diff --git a/_tutorial/wire_gen.go b/_tutorial/wire_gen.go
index 7a93a7b..fe54ab7 100644
--- a/_tutorial/wire_gen.go
+++ b/_tutorial/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/docs/guide.md b/docs/guide.md
index dc1b42e..530650a 100644
--- a/docs/guide.md
+++ b/docs/guide.md
@@ -151,7 +151,7 @@ Wire will produce an implementation of the injector in a file called
 ```go
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //+build !wireinject
 
 package main
diff --git a/internal/wire/wire.go b/internal/wire/wire.go
index a9b7a50..5cedeb1 100644
--- a/internal/wire/wire.go
+++ b/internal/wire/wire.go
@@ -267,7 +267,7 @@ func (g *gen) frame(tags string) []byte {
 		tags = fmt.Sprintf(" gen -tags \"%s\"", tags)
 	}
 	buf.WriteString("// Code generated by Wire. DO NOT EDIT.\n\n")
-	buf.WriteString("//go:generate go run github.com/google/wire/cmd/wire" + tags + "\n")
+	buf.WriteString("//go:generate go run -mod=mod github.com/google/wire/cmd/wire" + tags + "\n")
 	buf.WriteString("//+build !wireinject\n\n")
 	buf.WriteString("package ")
 	buf.WriteString(g.pkg.Name)


Test patch:
diff --git a/internal/wire/testdata/BindInjectorArg/want/wire_gen.go b/internal/wire/testdata/BindInjectorArg/want/wire_gen.go
index 25ce723..5f5b210 100644
--- a/internal/wire/testdata/BindInjectorArg/want/wire_gen.go
+++ b/internal/wire/testdata/BindInjectorArg/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/BindInjectorArgPointer/want/wire_gen.go b/internal/wire/testdata/BindInjectorArgPointer/want/wire_gen.go
index 20a9f53..15d6f0e 100644
--- a/internal/wire/testdata/BindInjectorArgPointer/want/wire_gen.go
+++ b/internal/wire/testdata/BindInjectorArgPointer/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/BindInterfaceWithValue/want/wire_gen.go b/internal/wire/testdata/BindInterfaceWithValue/want/wire_gen.go
index b6255e1..58d82bf 100644
--- a/internal/wire/testdata/BindInterfaceWithValue/want/wire_gen.go
+++ b/internal/wire/testdata/BindInterfaceWithValue/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/BuildTagsAllPackages/want/wire_gen.go b/internal/wire/testdata/BuildTagsAllPackages/want/wire_gen.go
index f75adb5..16c0df2 100644
--- a/internal/wire/testdata/BuildTagsAllPackages/want/wire_gen.go
+++ b/internal/wire/testdata/BuildTagsAllPackages/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/Chain/want/wire_gen.go b/internal/wire/testdata/Chain/want/wire_gen.go
index 257e642..cf9e9ee 100644
--- a/internal/wire/testdata/Chain/want/wire_gen.go
+++ b/internal/wire/testdata/Chain/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/Cleanup/want/wire_gen.go b/internal/wire/testdata/Cleanup/want/wire_gen.go
index eea8b22..1519c10 100644
--- a/internal/wire/testdata/Cleanup/want/wire_gen.go
+++ b/internal/wire/testdata/Cleanup/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/CopyOtherDecls/want/wire_gen.go b/internal/wire/testdata/CopyOtherDecls/want/wire_gen.go
index 3dcb4b5..c654540 100644
--- a/internal/wire/testdata/CopyOtherDecls/want/wire_gen.go
+++ b/internal/wire/testdata/CopyOtherDecls/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/DocComment/want/wire_gen.go b/internal/wire/testdata/DocComment/want/wire_gen.go
index a1027b9..3efb22a 100644
--- a/internal/wire/testdata/DocComment/want/wire_gen.go
+++ b/internal/wire/testdata/DocComment/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/ExampleWithMocks/want/wire_gen.go b/internal/wire/testdata/ExampleWithMocks/want/wire_gen.go
index 9f2fd0f..9cb7b01 100644
--- a/internal/wire/testdata/ExampleWithMocks/want/wire_gen.go
+++ b/internal/wire/testdata/ExampleWithMocks/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/ExportedValue/want/wire_gen.go b/internal/wire/testdata/ExportedValue/want/wire_gen.go
index d3ba454..7563ca2 100644
--- a/internal/wire/testdata/ExportedValue/want/wire_gen.go
+++ b/internal/wire/testdata/ExportedValue/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/ExportedValueDifferentPackage/want/wire_gen.go b/internal/wire/testdata/ExportedValueDifferentPackage/want/wire_gen.go
index d8bdd24..d8c74d4 100644
--- a/internal/wire/testdata/ExportedValueDifferentPackage/want/wire_gen.go
+++ b/internal/wire/testdata/ExportedValueDifferentPackage/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/FieldsOfImportedStruct/want/wire_gen.go b/internal/wire/testdata/FieldsOfImportedStruct/want/wire_gen.go
index fbdc062..8467ee3 100644
--- a/internal/wire/testdata/FieldsOfImportedStruct/want/wire_gen.go
+++ b/internal/wire/testdata/FieldsOfImportedStruct/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/FieldsOfStruct/want/wire_gen.go b/internal/wire/testdata/FieldsOfStruct/want/wire_gen.go
index c27e6d0..5b8ca2f 100644
--- a/internal/wire/testdata/FieldsOfStruct/want/wire_gen.go
+++ b/internal/wire/testdata/FieldsOfStruct/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/FieldsOfStructPointer/want/wire_gen.go b/internal/wire/testdata/FieldsOfStructPointer/want/wire_gen.go
index 6a03e81..c9fe795 100644
--- a/internal/wire/testdata/FieldsOfStructPointer/want/wire_gen.go
+++ b/internal/wire/testdata/FieldsOfStructPointer/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/FieldsOfValueStruct/want/wire_gen.go b/internal/wire/testdata/FieldsOfValueStruct/want/wire_gen.go
index 5b61dfe..793c04d 100644
--- a/internal/wire/testdata/FieldsOfValueStruct/want/wire_gen.go
+++ b/internal/wire/testdata/FieldsOfValueStruct/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/Header/want/wire_gen.go b/internal/wire/testdata/Header/want/wire_gen.go
index 3ab2107..2f8c5c6 100644
--- a/internal/wire/testdata/Header/want/wire_gen.go
+++ b/internal/wire/testdata/Header/want/wire_gen.go
@@ -2,7 +2,7 @@
 //
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/ImportedInterfaceBinding/want/wire_gen.go b/internal/wire/testdata/ImportedInterfaceBinding/want/wire_gen.go
index 6a7cd42..b68a1db 100644
--- a/internal/wire/testdata/ImportedInterfaceBinding/want/wire_gen.go
+++ b/internal/wire/testdata/ImportedInterfaceBinding/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/InjectInput/want/wire_gen.go b/internal/wire/testdata/InjectInput/want/wire_gen.go
index c17559c..9471cf6 100644
--- a/internal/wire/testdata/InjectInput/want/wire_gen.go
+++ b/internal/wire/testdata/InjectInput/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/InjectWithPanic/want/wire_gen.go b/internal/wire/testdata/InjectWithPanic/want/wire_gen.go
index 92cb390..8b124e5 100644
--- a/internal/wire/testdata/InjectWithPanic/want/wire_gen.go
+++ b/internal/wire/testdata/InjectWithPanic/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/InterfaceBinding/want/wire_gen.go b/internal/wire/testdata/InterfaceBinding/want/wire_gen.go
index f1d7f17..2c1a67b 100644
--- a/internal/wire/testdata/InterfaceBinding/want/wire_gen.go
+++ b/internal/wire/testdata/InterfaceBinding/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/InterfaceBindingReuse/want/wire_gen.go b/internal/wire/testdata/InterfaceBindingReuse/want/wire_gen.go
index bff6877..1c43771 100644
--- a/internal/wire/testdata/InterfaceBindingReuse/want/wire_gen.go
+++ b/internal/wire/testdata/InterfaceBindingReuse/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/InterfaceValue/want/wire_gen.go b/internal/wire/testdata/InterfaceValue/want/wire_gen.go
index 0cc1e8c..9868a90 100644
--- a/internal/wire/testdata/InterfaceValue/want/wire_gen.go
+++ b/internal/wire/testdata/InterfaceValue/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/MultipleSimilarPackages/want/wire_gen.go b/internal/wire/testdata/MultipleSimilarPackages/want/wire_gen.go
index a43b6e4..e406820 100644
--- a/internal/wire/testdata/MultipleSimilarPackages/want/wire_gen.go
+++ b/internal/wire/testdata/MultipleSimilarPackages/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/NamingWorstCase/want/wire_gen.go b/internal/wire/testdata/NamingWorstCase/want/wire_gen.go
index 23dd8fa..e32329d 100644
--- a/internal/wire/testdata/NamingWorstCase/want/wire_gen.go
+++ b/internal/wire/testdata/NamingWorstCase/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/NamingWorstCaseAllInOne/want/wire_gen.go b/internal/wire/testdata/NamingWorstCaseAllInOne/want/wire_gen.go
index dac690d..c081520 100644
--- a/internal/wire/testdata/NamingWorstCaseAllInOne/want/wire_gen.go
+++ b/internal/wire/testdata/NamingWorstCaseAllInOne/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/NiladicIdentity/want/wire_gen.go b/internal/wire/testdata/NiladicIdentity/want/wire_gen.go
index 92cb390..8b124e5 100644
--- a/internal/wire/testdata/NiladicIdentity/want/wire_gen.go
+++ b/internal/wire/testdata/NiladicIdentity/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/NiladicValue/want/wire_gen.go b/internal/wire/testdata/NiladicValue/want/wire_gen.go
index f75adb5..16c0df2 100644
--- a/internal/wire/testdata/NiladicValue/want/wire_gen.go
+++ b/internal/wire/testdata/NiladicValue/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/NoInjectParamNames/want/wire_gen.go b/internal/wire/testdata/NoInjectParamNames/want/wire_gen.go
index c943b5c..b8760db 100644
--- a/internal/wire/testdata/NoInjectParamNames/want/wire_gen.go
+++ b/internal/wire/testdata/NoInjectParamNames/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/PartialCleanup/want/wire_gen.go b/internal/wire/testdata/PartialCleanup/want/wire_gen.go
index a3ef6a4..6cf2640 100644
--- a/internal/wire/testdata/PartialCleanup/want/wire_gen.go
+++ b/internal/wire/testdata/PartialCleanup/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/PkgImport/want/wire_gen.go b/internal/wire/testdata/PkgImport/want/wire_gen.go
index 7dbc469..5f3e127 100644
--- a/internal/wire/testdata/PkgImport/want/wire_gen.go
+++ b/internal/wire/testdata/PkgImport/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/RelativePkg/want/wire_gen.go b/internal/wire/testdata/RelativePkg/want/wire_gen.go
index 92cb390..8b124e5 100644
--- a/internal/wire/testdata/RelativePkg/want/wire_gen.go
+++ b/internal/wire/testdata/RelativePkg/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/ReservedKeywords/want/wire_gen.go b/internal/wire/testdata/ReservedKeywords/want/wire_gen.go
index a8a6ae7..7ff3110 100644
--- a/internal/wire/testdata/ReservedKeywords/want/wire_gen.go
+++ b/internal/wire/testdata/ReservedKeywords/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/ReturnArgumentAsInterface/want/wire_gen.go b/internal/wire/testdata/ReturnArgumentAsInterface/want/wire_gen.go
index 5d73b54..9d1a331 100644
--- a/internal/wire/testdata/ReturnArgumentAsInterface/want/wire_gen.go
+++ b/internal/wire/testdata/ReturnArgumentAsInterface/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/ReturnError/want/wire_gen.go b/internal/wire/testdata/ReturnError/want/wire_gen.go
index 6a75977..5d97466 100644
--- a/internal/wire/testdata/ReturnError/want/wire_gen.go
+++ b/internal/wire/testdata/ReturnError/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/Struct/want/wire_gen.go b/internal/wire/testdata/Struct/want/wire_gen.go
index 3529cb2..e4bf0c7 100644
--- a/internal/wire/testdata/Struct/want/wire_gen.go
+++ b/internal/wire/testdata/Struct/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/StructPointer/want/wire_gen.go b/internal/wire/testdata/StructPointer/want/wire_gen.go
index 1fa1bd8..e96e8cd 100644
--- a/internal/wire/testdata/StructPointer/want/wire_gen.go
+++ b/internal/wire/testdata/StructPointer/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/TwoDeps/want/wire_gen.go b/internal/wire/testdata/TwoDeps/want/wire_gen.go
index 29cde76..bfc52d7 100644
--- a/internal/wire/testdata/TwoDeps/want/wire_gen.go
+++ b/internal/wire/testdata/TwoDeps/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/ValueChain/want/wire_gen.go b/internal/wire/testdata/ValueChain/want/wire_gen.go
index 9e4a669..da2cccb 100644
--- a/internal/wire/testdata/ValueChain/want/wire_gen.go
+++ b/internal/wire/testdata/ValueChain/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/ValueConversion/want/wire_gen.go b/internal/wire/testdata/ValueConversion/want/wire_gen.go
index 9c1c4b6..b663861 100644
--- a/internal/wire/testdata/ValueConversion/want/wire_gen.go
+++ b/internal/wire/testdata/ValueConversion/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/ValueIsStruct/want/wire_gen.go b/internal/wire/testdata/ValueIsStruct/want/wire_gen.go
index 9e0b96c..f41ed12 100644
--- a/internal/wire/testdata/ValueIsStruct/want/wire_gen.go
+++ b/internal/wire/testdata/ValueIsStruct/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/VarValue/want/wire_gen.go b/internal/wire/testdata/VarValue/want/wire_gen.go
index 8a2bc61..07e4f01 100644
--- a/internal/wire/testdata/VarValue/want/wire_gen.go
+++ b/internal/wire/testdata/VarValue/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject
 
diff --git a/internal/wire/testdata/Varargs/want/wire_gen.go b/internal/wire/testdata/Varargs/want/wire_gen.go
index d6cef6a..703a549 100644
--- a/internal/wire/testdata/Varargs/want/wire_gen.go
+++ b/internal/wire/testdata/Varargs/want/wire_gen.go
@@ -1,6 +1,6 @@
 // Code generated by Wire. DO NOT EDIT.
 
-//go:generate go run github.com/google/wire/cmd/wire
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
 //go:build !wireinject
 // +build !wireinject