简体   繁体   中英

go get error “go tool: no such tool ”compile"

I try to make a web app application with go and i need to use "go get" for it but when i use it the terminal response "go tool: no such tool "compile".

I was a beginner in go and i haven't used it since a long time and i'm not sure to understand where does the problem come from and what i'm suppose to do to fix it.

that my go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/usr/.cache/go-build"
GOENV="/home/usr/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/usr/go"
GOPRIVATE=""
GOPROXY="http://localhost:3000"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build608213333=/tmp/go-build -gno-record-gcc-switches"

compile tool is one of the tools in /usr/local/go/pkg/tool/linux_amd64 . Try running go tool -n compile : it should print the full path to the compile binary. Reinstalling go should fix the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM