我无法在$GOPATH
文件夹中运行go get git@github<user/repo>
.
GO:无法在GOPATH模式下使用PATH@VERSION语法
我只是想了解为什么在安装过程中配置了$GOPATH
,但go get
仍然不能工作.环境就是ubuntu.
~/$ echo $GOPATH
/home/user/go
我无法在$GOPATH
文件夹中运行go get git@github<user/repo>
.
GO:无法在GOPATH模式下使用PATH@VERSION语法
我只是想了解为什么在安装过程中配置了$GOPATH
,但go get
仍然不能工作.环境就是ubuntu.
~/$ echo $GOPATH
/home/user/go
正如您已经注意到的,您应该使用go get github.com/<user>/<repo>
.
您看到的错误消息来自go get
中实现的一个支持Go modules的新特性--您现在还可以指定依赖项的版本:go get github.com/<user>/<repo>@<version>
,其中version
是使用semver的GIT标签,例如v1.0.2
.