I started facing
go tool: no such tool "compile" error after installing a local build of go.
golang source was in
$ cd /usr/local
$ ls total 41240 drwxr-xr-x@ 19 root wheel 608B Oct 18 19:35 go drwxr-xr-x 16 root wheel 512B Oct 18 19:35 . -rw-r--r--@ 1 root wheel 20M Oct 18 19:35 go1.11.13.src.tar.gz
go installation as following:
cd src; ./all.bash
The final build output was
Installed Go for darwin/amd64 in /usr/local/go Installed commands in /usr/local/go/bin
Now the PATH & GOROOT must have the following values:
$ export GOROOT=/usr/local/go $export PATH=/usr/local/go/bin:$PATH
GOPATH value fixed te problem.
What didn’t work
- Setting GOTOOLDIR
- Reinstalling GO