Skip to content

Commit 1fd78e1

Browse files
committed
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 <[email protected]>
1 parent eddd7ff commit 1fd78e1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/cmd/go/tool.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ func runTool(cmd *Command, args []string) {
9898
fmt.Printf("%s\n", cmd)
9999
return
100100
}
101+
args[0] = toolPath // in case the tool wants to re-exec itself, e.g. cmd/dist
101102
toolCmd := &exec.Cmd{
102103
Path: toolPath,
103104
Args: args,

0 commit comments

Comments
 (0)