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

Published by

风君子

独自遨游何稽首 揭天掀地慰生平

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注