Skip to content

Commit

Permalink
use -mod=readonly rather than -mod= for go list
Browse files Browse the repository at this point in the history
The empty string is not a valid value for the -mod flag, and it fails when using a workspace too:

    go: -mod may only be set to readonly or vendor when in workspace mode, but it is set to ""
  • Loading branch information
dydysy authored Aug 27, 2024
1 parent c41f026 commit a99fbcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func appendListedPackages(packages []string, mainBuild bool) error {
// However, when loading standard library packages,
// using those flags would likely result in an error,
// as the standard library uses its own Go module and vendoring.
args = append(args, "-mod=", "-modfile=")
args = append(args, "-mod=readonly", "-modfile=")
}

args = append(args, packages...)
Expand Down

0 comments on commit a99fbcb

Please sign in to comment.