]> Cypherpunks repositories - gostls13.git/commit
all: correct location of go tool
authorHiroshi Ioka <hirochachacha@gmail.com>
Tue, 19 Sep 2017 09:18:09 +0000 (18:18 +0900)
committerIan Lance Taylor <iant@golang.org>
Wed, 20 Sep 2017 03:54:16 +0000 (03:54 +0000)
commitfb54abe9ce3cbec6d464c238406b05502cb34eeb
tree596ae2eb647e4c2b0b1d023ede6c85d5a55099b7
parent88ced021907fb96d5609a3c63db0d9738bf0ac2b
all: correct location of go tool

In general, there are no guarantee that `go` command exist on $PATH.
This CL tries to get `go` command from $GOROOT/bin instead.

There are three kinds of code we should handle:
    For normal code, the CL implements goCmd() or goCmdName().
    For unit tests, the CL uses testenv.GoTool() or testenv.GoToolPath().
    For integration tests, the CL sets PATH=$GOROOT/bin:$PATH in cmd/dist.

Note that make.bash sets PATH=$GOROOT/bin:$PATH in the build process.
So this change is only useful when we use toolchain manually.

Updates #21875

Change-Id: I963b9f22ea732dd735363ececde4cf94a5db5ca2
Reviewed-on: https://go-review.googlesource.com/64650
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/api/goapi.go
src/cmd/api/goapi_test.go
src/cmd/api/run.go
src/cmd/dist/test.go
src/cmd/go/go_test.go
src/cmd/link/internal/ld/nooptcgolink_test.go
src/cmd/trace/pprof.go
src/internal/trace/parser.go
src/os/os_windows_test.go
src/runtime/syscall_windows_test.go