Skip to content

go generate ./... no longer works with go 1.22.0 and wire 0.6.0 #403

@scr-oath

Description

@scr-oath

Describe the bug

wire ./... seems to work fine, but go generate ./... now fails due to the use of go run with -mod=mod

go version
go version go1.22.0 darwin/arm64

grep wire go.mod 
        github.com/google/wire v0.6.0

To Reproduce

Create a wired module and try to run generate to re-wire it.

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.

Expected behavior

go generate should work just as well as wire - the generated //go:generate line should not be so different that it cannot run.

Version

0.6.0

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions