最近更新的最新的golang版本go version go1.16.4 windows/amd64
关于不带 @version 的 go install
在模块外,不带 @version 是无法安装的,在安装插件的时候会有如下错误:
D:\go>go install github.com/ramya-rao-a/go-outline
go install: version is required when current directory is not in a module
Try 'go install github.com/ramya-rao-a/go-outline@latest' to install the latest version
根据提示,我们加上了@latest作为版本号还是失败。
D:\go\src>go install github.com/mdempsky/gocode@latest
go install github.com/mdempsky/gocode@latest: no matching versions for query "latest"
解决办法:try go get -u -v
D:\go\src>go get -u -v github.com/mdempsky/gocode
go: downloading github.com/mdempsky/gocode v0.0.0-20200405233807-4acdcbdea79d
go: downloading golang.org/x/tools v0.1.1
golang.org/x/tools/go/internal/gcimporter
github.com/mdempsky/gocode/internal/lookdot
github.com/mdempsky/gocode/internal/suggest
golang.org/x/tools/go/gcexportdata
github.com/mdempsky/gocode/internal/cache
github.com/mdempsky/gocode/internal/gbimporter
github.com/mdempsky/gocode
D:\go\src>go install github.com/mdempsky/gocode@latest
go: finding module for package golang.org/x/tools/go/gcexportdata
go: found golang.org/x/tools/go/gcexportdata in golang.org/x/tools v0.1.1
再去看D:\go\bin可以看到gocode.exe已安装
![](https://img-blog.csdnimg.cn/img_convert/96d715811c4e10b08e075894728bbe3e.webp?x-oss-process=image/format,png)
1621413060.png
参考:https://blog.csdn.net/love666666shen/article/details/104382356
尚未解决的问题
go install github.com/stamblerre/gocode
go install github.com/mdempsky/gocode两个冲突的问题
©
著作权归作者所有,转载或内容合作请联系作者
![](https://img-blog.csdnimg.cn/direct/67c64049147741939b85489caefbb597.png)
喜欢的朋友记得点赞、收藏、关注哦!!!