From a99fbcbe43c12eac399ee756477ef558effddb2f Mon Sep 17 00:00:00 2001 From: dydysy <200615@gmail.com> Date: Tue, 27 Aug 2024 16:13:19 +0800 Subject: [PATCH] use -mod=readonly rather than -mod= for go list 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 "" --- shared.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared.go b/shared.go index 719c21a..1c3cb67 100644 --- a/shared.go +++ b/shared.go @@ -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...)