简体   繁体   English

go 得到错误“去工具:没有这样的工具”编译“

[英]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".我尝试使用 go 制作 web 应用程序应用程序,我需要为它使用“go get”,但是当我使用它时,终端响应“go tool:没有这样的工具“编译”。

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.我是 go 的初学者,我已经很久没有使用它了,我不确定问题出在哪里以及我应该做些什么来解决它。

that my go env我的 go 环境

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 . compile工具是/usr/local/go/pkg/tool/linux_amd64中的工具之一。 Try running go tool -n compile : it should print the full path to the compile binary.尝试运行go tool -n compile :它应该打印compile二进制文件的完整路径。 Reinstalling go should fix the problem.重新安装 go 应该可以解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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