我很难确定工具中当前位于何处。
$ go tool
cgo
cover
vet
cover不在路径上
$ which cover
/usr/bin/which: no cover in ...
这是围棋环境:
$ go env
GOARCH="amd64"
GOBIN="~/go//bin"
GOCACHE="~/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="~/go/"
GORACE=""
GOROOT="/usr/bin/go"
GOTMPDIR=""
GOTOOLDIR="/usr/libexec/gcc/x86_64-redhat-linux/8"
GCCGO="/usr/bin/gccgo"
~/go/bin
为空:
$ ls -a ~/go/
. .. pkg
去哪里挑选工具?
答案 0 :(得分:2)
在我的安装中,它们位于GOTOOLDIR
输出的go env
中。
~% go env | grep GOTOOLDIR
GOTOOLDIR="/usr/local/Cellar/go/1.11.1/libexec/pkg/tool/darwin_amd64"
~% ls /usr/local/Cellar/go/1.11.1/libexec/pkg/tool/darwin_amd64
addr2line buildid cover fix objdump test2json
api cgo dist link pack trace
asm compile doc nm pprof vet