go:远程包安装问题

Posted luoheng23

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了go:远程包安装问题相关的知识,希望对你有一定的参考价值。

在使用go get安装gopls时发现连接超时,错误如下:

命令

go get golang.org/x/tools/gopls

输出

package golang.org/x/sync/errgroup: unrecognized import path "golang.org/x/sync/errgroup" (https fetch: Get https://golang.org/x/sync/errgroup?go-get=1: dial tcp 216.239.37.1:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)

解决方案

由于golang.org/xgithub/golang下有镜像文件,故手动在$GOPATH/src目录创建golang.org/x子目录,并进入目录中,clonegithub/golang下的仓库。

git clone https://github.com/golang/gopls

以上是关于go:远程包安装问题的主要内容,如果未能解决你的问题,请参考以下文章