博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在VSCode中成功安装Go相关插件问题:tools failed to install.
阅读量:6931 次
发布时间:2019-06-27

本文共 20194 字,大约阅读时间需要 67 分钟。

一、介绍

目的:本文将主要介绍在windows使用VSCode配置Go语言环境

软件:VSCode

 

二、安装出现的问题

完整信息如下

Installing 8 tools at D:\GoPath\bin  go-outline  go-symbols  guru  gorename  dlv  godef  goreturns  golintInstalling golang.org/x/tools/cmd/guru FAILEDInstalling github.com/ramya-rao-a/go-outline FAILEDInstalling golang.org/x/tools/cmd/gorename FAILEDInstalling github.com/derekparker/delve/cmd/dlv SUCCEEDEDInstalling github.com/acroca/go-symbols FAILEDInstalling golang.org/x/tools/cmd/guru FAILEDInstalling github.com/rogpeppe/godef SUCCEEDEDInstalling golang.org/x/tools/cmd/gorename FAILEDInstalling github.com/derekparker/delve/cmd/dlv SUCCEEDEDInstalling github.com/rogpeppe/godef SUCCEEDEDInstalling github.com/sqs/goreturns FAILEDInstalling github.com/golang/lint/golint FAILED6 tools failed to install.go-outline:Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/ramya-rao-a/go-outlinegithub.com/ramya-rao-a/go-outline (download)Fetching https://golang.org/x/tools/go/buildutil?go-get=1https fetch failed: Get https://golang.org/x/tools/go/buildutil?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.package golang.org/x/tools/go/buildutil: unrecognized import path "golang.org/x/tools/go/buildutil" (https fetch: Get https://golang.org/x/tools/go/buildutil?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.)github.com/ramya-rao-a/go-outline (download)Fetching https://golang.org/x/tools/go/buildutil?go-get=1https fetch failed: Get https://golang.org/x/tools/go/buildutil?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.package golang.org/x/tools/go/buildutil: unrecognized import path "golang.org/x/tools/go/buildutil" (https fetch: Get https://golang.org/x/tools/go/buildutil?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.)go-symbols:Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/acroca/go-symbolsgithub.com/acroca/go-symbols (download)Fetching https://golang.org/x/tools/go/buildutil?go-get=1https fetch failed: Get https://golang.org/x/tools/go/buildutil?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.package golang.org/x/tools/go/buildutil: unrecognized import path "golang.org/x/tools/go/buildutil" (https fetch: Get https://golang.org/x/tools/go/buildutil?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.)github.com/acroca/go-symbols (download)Fetching https://golang.org/x/tools/go/buildutil?go-get=1https fetch failed: Get https://golang.org/x/tools/go/buildutil?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.package golang.org/x/tools/go/buildutil: unrecognized import path "golang.org/x/tools/go/buildutil" (https fetch: Get https://golang.org/x/tools/go/buildutil?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.)guru:Error: Command failed: C:\Go\bin\go.exe get -u -v golang.org/x/tools/cmd/guruFetching https://golang.org/x/tools/cmd/guru?go-get=1https fetch failed: Get https://golang.org/x/tools/cmd/guru?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.package golang.org/x/tools/cmd/guru: unrecognized import path "golang.org/x/tools/cmd/guru" (https fetch: Get https://golang.org/x/tools/cmd/guru?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.)Fetching https://golang.org/x/tools/cmd/guru?go-get=1https fetch failed: Get https://golang.org/x/tools/cmd/guru?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.package golang.org/x/tools/cmd/guru: unrecognized import path "golang.org/x/tools/cmd/guru" (https fetch: Get https://golang.org/x/tools/cmd/guru?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.)gorename:Error: Command failed: C:\Go\bin\go.exe get -u -v golang.org/x/tools/cmd/gorenameFetching https://golang.org/x/tools/cmd/gorename?go-get=1https fetch failed: Get https://golang.org/x/tools/cmd/gorename?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.package golang.org/x/tools/cmd/gorename: unrecognized import path "golang.org/x/tools/cmd/gorename" (https fetch: Get https://golang.org/x/tools/cmd/gorename?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.)Fetching https://golang.org/x/tools/cmd/gorename?go-get=1https fetch failed: Get https://golang.org/x/tools/cmd/gorename?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.package golang.org/x/tools/cmd/gorename: unrecognized import path "golang.org/x/tools/cmd/gorename" (https fetch: Get https://golang.org/x/tools/cmd/gorename?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.)goreturns:Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/sqs/goreturnsgithub.com/sqs/goreturns (download)Fetching https://golang.org/x/tools/imports?go-get=1https fetch failed: Get https://golang.org/x/tools/imports?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.package golang.org/x/tools/imports: unrecognized import path "golang.org/x/tools/imports" (https fetch: Get https://golang.org/x/tools/imports?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.)github.com/sqs/goreturns (download)Fetching https://golang.org/x/tools/imports?go-get=1https fetch failed: Get https://golang.org/x/tools/imports?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.package golang.org/x/tools/imports: unrecognized import path "golang.org/x/tools/imports" (https fetch: Get https://golang.org/x/tools/imports?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.)golint:Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/golang/lint/golintgithub.com/golang/lint (download)Fetching https://golang.org/x/lint?go-get=1https fetch failed: Get https://golang.org/x/lint?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.package golang.org/x/lint: unrecognized import path "golang.org/x/lint" (https fetch: Get https://golang.org/x/lint?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.)github.com/golang/lint (download)Fetching https://golang.org/x/lint?go-get=1https fetch failed: Get https://golang.org/x/lint?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.package golang.org/x/lint: unrecognized import path "golang.org/x/lint" (https fetch: Get https://golang.org/x/lint?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.)Installing github.com/sqs/goreturns FAILEDInstalling github.com/golang/lint/golint FAILED6 tools failed to install.go-outline:Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/ramya-rao-a/go-outlinegithub.com/ramya-rao-a/go-outline (download)Fetching https://golang.org/x/tools/go/buildutil?go-get=1https fetch failed: Get https://golang.org/x/tools/go/buildutil?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.package golang.org/x/tools/go/buildutil: unrecognized import path "golang.org/x/tools/go/buildutil" (https fetch: Get https://golang.org/x/tools/go/buildutil?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.)github.com/ramya-rao-a/go-outline (download)Fetching https://golang.org/x/tools/go/buildutil?go-get=1https fetch failed: Get https://golang.org/x/tools/go/buildutil?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.package golang.org/x/tools/go/buildutil: unrecognized import path "golang.org/x/tools/go/buildutil" (https fetch: Get https://golang.org/x/tools/go/buildutil?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.)go-symbols:Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/acroca/go-symbolsgithub.com/acroca/go-symbols (download)Fetching https://golang.org/x/tools/go/buildutil?go-get=1https fetch failed: Get https://golang.org/x/tools/go/buildutil?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.package golang.org/x/tools/go/buildutil: unrecognized import path "golang.org/x/tools/go/buildutil" (https fetch: Get https://golang.org/x/tools/go/buildutil?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.)github.com/acroca/go-symbols (download)Fetching https://golang.org/x/tools/go/buildutil?go-get=1https fetch failed: Get https://golang.org/x/tools/go/buildutil?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.package golang.org/x/tools/go/buildutil: unrecognized import path "golang.org/x/tools/go/buildutil" (https fetch: Get https://golang.org/x/tools/go/buildutil?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.)guru:Error: Command failed: C:\Go\bin\go.exe get -u -v golang.org/x/tools/cmd/guruFetching https://golang.org/x/tools/cmd/guru?go-get=1https fetch failed: Get https://golang.org/x/tools/cmd/guru?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.package golang.org/x/tools/cmd/guru: unrecognized import path "golang.org/x/tools/cmd/guru" (https fetch: Get https://golang.org/x/tools/cmd/guru?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.)Fetching https://golang.org/x/tools/cmd/guru?go-get=1https fetch failed: Get https://golang.org/x/tools/cmd/guru?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.package golang.org/x/tools/cmd/guru: unrecognized import path "golang.org/x/tools/cmd/guru" (https fetch: Get https://golang.org/x/tools/cmd/guru?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.)gorename:Error: Command failed: C:\Go\bin\go.exe get -u -v golang.org/x/tools/cmd/gorenameFetching https://golang.org/x/tools/cmd/gorename?go-get=1https fetch failed: Get https://golang.org/x/tools/cmd/gorename?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.package golang.org/x/tools/cmd/gorename: unrecognized import path "golang.org/x/tools/cmd/gorename" (https fetch: Get https://golang.org/x/tools/cmd/gorename?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.)Fetching https://golang.org/x/tools/cmd/gorename?go-get=1https fetch failed: Get https://golang.org/x/tools/cmd/gorename?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.package golang.org/x/tools/cmd/gorename: unrecognized import path "golang.org/x/tools/cmd/gorename" (https fetch: Get https://golang.org/x/tools/cmd/gorename?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.)goreturns:Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/sqs/goreturnsgithub.com/sqs/goreturns (download)# cd D:\GoPath\src\github.com\sqs\goreturns; git pull --ff-onlyfatal: early EOFfatal: The remote end hung up unexpectedlyfatal: index-pack failederror: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054package github.com/sqs/goreturns: exit status 1github.com/sqs/goreturns (download)# cd D:\GoPath\src\github.com\sqs\goreturns; git pull --ff-onlyfatal: early EOFfatal: The remote end hung up unexpectedlyfatal: index-pack failederror: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054package github.com/sqs/goreturns: exit status 1golint:Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/golang/lint/golintgithub.com/golang/lint (download)Fetching https://golang.org/x/lint?go-get=1https fetch failed: Get https://golang.org/x/lint?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.package golang.org/x/lint: unrecognized import path "golang.org/x/lint" (https fetch: Get https://golang.org/x/lint?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.)github.com/golang/lint (download)Fetching https://golang.org/x/lint?go-get=1https fetch failed: Get https://golang.org/x/lint?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.package golang.org/x/lint: unrecognized import path "golang.org/x/lint" (https fetch: Get https://golang.org/x/lint?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.)

 

三、解决方案

进行如下命令进行目录切换:

cd %GOPATH%\src\github.com\golang
我这里的GOPATH是在D:\GoPath,大家这里一定要注意些
如果src目录下面没有github.com\golang文件夹请自行创建

完成目录切换后,开始下载插件包,在切换后的目录下进入命令行界面,可以用git bash:

git clone  tools

当下载完成后,你会发现%GOPATH%\src\github.com\golang多了一个tools目录

需要把tools目录下的所有文件拷贝到%GOPATH%\src\golang.org\x\tools下,如果没有自行创建。

 

这时我想偷个懒,再重新打开VSCode时,发现只有一个安装包安装失败

 

这时可以转换成手动安装:

将目录切换到GOPATH目录下,执行相关的go install 命令

go get -u -v github.com/ramya-rao-a/go-outlinego get -u -v github.com/acroca/go-symbolsgo get -u -v github.com/mdempsky/gocodego get -u -v github.com/rogpeppe/godefgo get -u -v golang.org/x/tools/cmd/godocgo get -u -v github.com/zmb3/gogetdocgo get -u -v github.com/golang/lint/golintgo get -u -v github.com/fatih/gomodifytagsgo get -u -v golang.org/x/tools/cmd/gorenamego get -u -v sourcegraph.com/sqs/goreturnsgo get -u -v golang.org/x/tools/cmd/goimportsgo get -u -v github.com/cweill/gotests/...go get -u -v golang.org/x/tools/cmd/gurugo get -u -v github.com/josharian/implgo get -u -v github.com/haya14busa/goplay/cmd/goplaygo get -u -v github.com/uudashr/gopkgs/cmd/gopkgsgo get -u -v github.com/davidrjenni/reftools/cmd/fillstructgo get -u -v github.com/alecthomas/gometalintergometalinter --install

 

 

四、参考资料

 

转载地址:http://ujmjl.baihongyu.com/

你可能感兴趣的文章
FFMPEG函数fill_buffer()
查看>>
ZooKeeper示例 实时更新server列表
查看>>
网络设备Telnet的配置及验证
查看>>
OSI 模型(标准)
查看>>
Spring Cloud构建微服务架构:服务消费(基础)
查看>>
Linux grep 命令正则匹配IP地址
查看>>
基本的子网划分 简述
查看>>
电脑监控软件来帮忙 公司内鬼难得逞
查看>>
MongoDB安装以及MongoDB开启多实例
查看>>
共享经济时代,逸管家联合体集团引领中小企业走向辉煌
查看>>
APP新手怎么统计推广数据?
查看>>
集合简概
查看>>
3.2权限管理
查看>>
django的models部分使用小结
查看>>
华为7.0系统手机最完美激活Xposed框架的教程
查看>>
新年开篇,回顾2018年互联网套路简史
查看>>
nginx.conf 静态项目配置文件
查看>>
趋势报告:5G折叠屏引热潮,智能机市场再雄起?
查看>>
繁忙的IT基础设施可能导致安全灾难
查看>>
Objective-C之Block
查看>>