You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 25, 2025. It is now read-only.
$ go generate
go: -mod may only be set to readonly or vendor when in workspace mode, but it is set to "mod"
Remove the -mod flag to use the default readonly value,
or set GOWORK=off to disable workspace mode.
wire_gen.go:3: running "go": exit status 1
In wire_gen.go, this is produced:
// Code generated by Wire. DO NOT EDIT.//go:generate go run -mod=mod github.com/google/wire/cmd/wire//go:build !wireinject// +build !wireinject
For now, the workaround would be to set GOWORK=off env variable when running go generate. However, this may may be overlooked in a CI/CD pipeline.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
I am running the 1.24rc2 toolchain.
What operating system and processor architecture are you using (
go env)?go envOutputWhat did you do?
Ran
go generatein a main module in a workspace containing wire injectors.What did you expect to see?
No errors.
What did you see instead?
In
wire_gen.go, this is produced:For now, the workaround would be to set GOWORK=off env variable when running go generate. However, this may may be overlooked in a CI/CD pipeline.