diff --git a/tools/nogo/cli/cli.go b/tools/nogo/cli/cli.go index 5692fc6ec5c..1cb0cebe80b 100644 --- a/tools/nogo/cli/cli.go +++ b/tools/nogo/cli/cli.go @@ -514,7 +514,7 @@ func (r *Render) Execute(ctx context.Context, fs *flag.FlagSet, args ...any) sub } // goVersionRe matches a `go VERSION` line in go.mod, capturing VERSION. -var goVersionRe = regexp.MustCompile(`^go\s+(\S+)`) +var goVersionRe = regexp.MustCompile(`(?m)^go\s+(\S+)`) // resolveGOVERSION sets flags.GOVERSION from flags.GOVERSIONModFile, if necessary. func resolveGOVERSION() error { diff --git a/tools/nogo/defs.bzl b/tools/nogo/defs.bzl index 0be8a408d69..3072168bf2b 100644 --- a/tools/nogo/defs.bzl +++ b/tools/nogo/defs.bzl @@ -70,7 +70,7 @@ def _nogo_stdlib_impl(ctx): go_ctx, args, inputs, raw_findings = _nogo_config(ctx, deps = []) # GOVERSION of std is set by the std go.mod. - args.append("-GOVERSION-mod-file=%s" % go_ctx.stdlib_mod) + args.append("-GOVERSION-mod-file=%s" % go_ctx.stdlib_mod.path) # Build the analyzer command. facts_file = ctx.actions.declare_file(ctx.label.name + ".facts")