golang The "gopls" command is not available. Use "go get -v golang.org/x/tools/cmd/gopls" to install.

vscode启动,出现下面提示,点安装会失败。 

The "gopls" command is not available. Use "go get -v golang.org/x/tools/cmd/gopls" to install.

下面是手工解决方案:

github.com中对应golang.org/x/tools/的路径:

https://github.com/Go-zh/tools.git 

git clone ,如果慢,就直接下载ZIP吧。

然后解压到: $GOPATH/src/github.com/Go-zh/tools

gopls路径为:$GOPATH/src/github.com/Go-zh/tools/cmd/gopls

 

然后安装就行了:

cd $GOPATH/src
go install github.com/Go-zh/tools/cmd/gopls

posted @ 2019-12-13 14:51  Ellen_Fu  阅读(4900)  评论(0编辑  收藏  举报