diff --git a/src/cmd/go/internal/tool/tool.go b/src/cmd/go/internal/tool/tool.go index 7033eb1d9c3587..18d0804bc9aa9d 100644 --- a/src/cmd/go/internal/tool/tool.go +++ b/src/cmd/go/internal/tool/tool.go @@ -44,7 +44,7 @@ may be defined in the go.mod of the current module. With no arguments it prints the list of known tools. The -n flag causes tool to print the command that would be -executed but not execute it. +executed but not execute it. (the path to the executable shown may not actually exist.) The -modfile=file.mod build flag causes tool to use an alternate file instead of the go.mod in the module root directory. @@ -302,6 +302,7 @@ func buildAndRunModtool(ctx context.Context, tool string, args []string) { p.Internal.OmitDebug = true p.Internal.ExeName = p.DefaultExecName() + cfg.BuildN = toolN a1 := b.LinkAction(work.ModeBuild, work.ModeBuild, p) a1.CacheExecutable = true a := &work.Action{Mode: "go tool", Actor: work.ActorFunc(runBuiltTool), Args: args, Deps: []*work.Action{a1}}