From: Shenghou Ma Date: Fri, 11 Sep 2015 04:26:50 +0000 (-0400) Subject: cmd/go: provide full path as os.Args[0] when invoking tools X-Git-Tag: go1.6beta1~1043 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1fd78e1f600d10475b85381427bda9f14f86e0f0;p=gostls13.git cmd/go: provide full path as os.Args[0] when invoking tools cmd/dist needs to re-exec or open itself to detect GOARM (CL 3973) and detect host machine endianness (CL 14460). Change-Id: If6438831ab0715ba8e236d64bb2c7c1bde1470aa Reviewed-on: https://go-review.googlesource.com/14476 Reviewed-by: Ian Lance Taylor --- diff --git a/src/cmd/go/tool.go b/src/cmd/go/tool.go index 937ca1f306..9ff0dcfb12 100644 --- a/src/cmd/go/tool.go +++ b/src/cmd/go/tool.go @@ -98,6 +98,7 @@ func runTool(cmd *Command, args []string) { fmt.Printf("%s\n", cmd) return } + args[0] = toolPath // in case the tool wants to re-exec itself, e.g. cmd/dist toolCmd := &exec.Cmd{ Path: toolPath, Args: args,