英文:
GoLang: getting this error upon go install
问题
当我输入'go install'时,我收到了以下错误信息:
root@kali:~/Scripts/Enum/gobuster# go install
go install: GOPATH之外的目录/root/Scripts/Enum/gobuster没有安装位置
更多详情请参阅:go help gopath
我的'go env'如下所示:
root@kali:~/Scripts/Enum/gobuster# go env
GOARCH="386"
GOBIN=""
GOEXE=""
GOHOSTARCH="386"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_386"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m32 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
有人可以帮忙吗?
谢谢。
英文:
I am getting this error message when typing 'go install'.
root@kali:~/Scripts/Enum/gobuster# go install
go install: no install location for directory /root/Scripts/Enum/gobuster outside GOPATH
For more details see: go help gopath
My 'go env' is as following.
root@kali:~/Scripts/Enum/gobuster# go env
GOARCH="386"
GOBIN=""
GOEXE=""
GOHOSTARCH="386"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_386"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m32 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
Can someone help please?
Thank you.
答案1
得分: 1
@Young Jang,
你需要将你的代码放在一个非常特定的位置,即Go的工作区下,同时还要按照一定的位置格式来匹配你的代码库,例如:
~/go/src/github.com/young_jang/gobuster
更多详情请参考:https://www.goinggo.net/2016/05/installing-go-and-your-workspace.html
英文:
@Young Jang,
You need to keep your code in a very specific location, i.e. under the Go's workspace, but also, following a location format to match your repository,
for example:
~/go/src/github.com/young_jang/gobuster
More details: https://www.goinggo.net/2016/05/installing-go-and-your-workspace.html
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论