GO语言教程2:使用VS code进行go语言的编写和运行
文章目录
- Go语言系列教程:https://blog.csdn.net/zhangpeterx/article/details/89040274
- 1.安装vs code和go语言插件
- 2.解决方案:
Go语言系列教程:https://blog.csdn.net/zhangpeterx/article/details/89040274
1.安装vs code和go语言插件
vs code官网下载地址:Visual Studio Code - Code Editing. Redefined
然后安装插件:GO
安装过程中会报错如下:
Installing github.com/stamblerre/gocode SUCCEEDED
Installing github.com/ianthehat/godef SUCCEEDED
Installing golang.org/x/lint/golint FAILED
gocode:
Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/mdempsky/gocode
github.com/mdempsky/gocode (download)
Fetching https://golang.org/x/tools/go/gcexportdata?go-get=1
https fetch failed: Get https://golang.org/x/tools/go/gcexportdata?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/gcexportdata: unrecognized import path "golang.org/x/tools/go/gcexportdata" (https fetch: Get https://golang.org/x/tools/go/gcexportdata?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/mdempsky/gocode (download)
Fetching https://golang.org/x/tools/go/gcexportdata?go-get=1
https fetch failed: Get https://golang.org/x/tools/go/gcexportdata?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/gcexportdata: unrecognized import path "golang.org/x/tools/go/gcexportdata" (https fetch: Get https://golang.org/x/tools/go/gcexportdata?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.)
2.解决方案:
1.在%GOPATH%\src\ 目录下,建立 golang.org 文件夹,并再新建x文件夹。
在%GOPATH\src\golang.org\x\目录下运行如下命令:
git clone https://github.com/golang/tools.git tools
go install github.com/ramya-rao-a/go-outline
go install github.com/acroca/go-symbols
go install golang.org/x/tools/cmd/guru
go install golang.org/x/tools/cmd/gorename
go install github.com/josharian/impl
go install github.com/rogpeppe/godef
go install github.com/sqs/goreturns
go install github.com/golang/lint/golint
go install github.com/cweill/gotests/gotests
go install github.com/ramya-rao-a/go-outline
go install github.com/acroca/go-symbols
go install golang.org/x/tools/cmd/guru
go install golang.org/x/tools/cmd/gorename
go install github.com/josharian/impl
go install github.com/rogpeppe/godef
go install github.com/sqs/goreturns
go install github.com/golang/lint/golint
go install github.com/cweill/gotests/gotests
然后切回到vs code,插件就可以正常安装了。
运行成功:
如果还是不行的话尝试一下代理
参考资料:
- VSCode安装go语言开发环境,go插件问题解决
GO语言教程2:使用VS code进行go语言的编写和运行相关推荐
- C语言教程,30分钟彻底学会C语言指针视频教程
c语言教程视频讲座简介: 沉睡者IT:C语言教程,30分钟彻底学会C语言指针视频教程 培训课程内容介绍: 此课程是针对C.C++指针的专题课程,通过对指针本质的讲解,帮助学员对指针快速的理解,并讲结合 ...
- GO语言教程1:Linux--debian/ubuntu下Go语言的安装
Go语言系列教程:https://blog.csdn.net/zhangpeterx/article/details/89040274 可以直接使用apt进行安装: apt install golan ...
- GO语言教程1:Windows环境下GO语言的安装与配置
文章目录 1.下载和安装 2.设置环境变量和GOPATH目录 Go语言系列教程:https://blog.csdn.net/zhangpeterx/article/details/89040274 1 ...
- c语言教程苏小红,《数据结构(C语言)》苏小红 课本案例
期末了,赶紧复习一波,手打一份书上的代码以便随时查阅 第二章: //顺序表存储结构 #define MAXSIZE 100 typedef struct { Elemtype *elemt; int ...
- Xamarin XAML语言教程Visual Studio中实现XAML预览
2019独角兽企业重金招聘Python工程师标准>>> Xamarin XAML语言教程Visual Studio中实现XAML预览 每次通过编译运行的方式查看XAML文件效果,需要 ...
- Xamarin XAML语言教程构建进度条ProgressBar
Xamarin XAML语言教程构建进度条ProgressBar Xamarin XAML语言教程构建进度条ProgressBar,ProgressBar被称为进度条,它类似于没有滑块的滑块控件.进度 ...
- Swift3.0语言教程字符串转换为数字值
Swift3.0语言教程字符串转换为数字值 Swift3.0语言教程字符串转换为数字值,在NSString中,开发者可以将字符串转换为数字值,通过这些数字值可以实现一些功能,如加法运算.减法运算等.数 ...
- Swift3.0语言教程比较、判断字符串
Swift3.0语言教程比较.判断字符串 Swift3.0语言教程比较.判断字符串,在一个程序中字符串很多时,常常会做的操作就是对这些字符串进行比较和判断.本小节将讲解这些内容. 1.不区分大小写比较 ...
- Swift语言教程中文文档
Swift语言教程中文文档 Swift语言教程(一)基础数据类型 Swift语言教程(二)基础数据类型 Swift语言教程(三)集合类型 Swift语言教程(四) 集合类型 Swift语言教程(五)控 ...
最新文章
- SpringCloud服务消费者第一次调用出现超时问题的解决方案
- php变量值随机,PHP生成各类随机数值
- 第四届“传智杯”全国大学生IT技能大赛(决赛B组)【题解】
- 在Linux PC上查看arm交叉编译的可执行文件依赖的动态库
- 关于WebSocket分布式实现的一种方案
- 【数学基础】拉格朗日对偶
- centos6实现kvm嵌套虚拟化
- 关于myBatis的问题There is no getter for property named 'USER_NAME' in 'class com.bky.model.实例类'
- ipsec *** 的总结性谈论
- 精诚合作 共创未来——阿里云数据智能合作策略介绍
- 一位软件工程师的6年总结收藏
- linux内核提高系统实时性,Linux操作系统实时性分析及改进策略
- 2011-6-22精品软件【清风网络整理】
- KubeSphere 3.3.0 离线安装教程
- 网通修改了偶的ADSL登录密码
- msn 邮箱服务器,MSN邮箱的POP怎么设置?
- 方框加对勾怎么输入_word里如何往方框中加对号?带方框的对号怎么弄,原来是这样的...
- NSSCTF部分复现
- 利用主成分PCA进行特征提取
- CentOS7 使用二进制部署 Kubernetes 1.15-1.17集群(均通用,已经尝试,细心)
热门文章
- RDKit:计算不同小分子构象之间的RMSD
- 其他算法-LSH局部敏感度哈希
- android布局共享,布局共享(如所有ACTIVITY拥有相同的布局部分,比如ACTIONBAR,在BASEACTIVITY中写入布局)...
- 代码居中对齐_一篇文章带你了解CSS对齐方式
- 基于 gulp 的 fancybox 源码压缩
- Iso-Seq3|三代全长转录组分析
- The Innovation | Volume 2 Issue3 正式出版
- 赖江山:生态学研究都在用哪些R包?
- cookie追加数据_集算器 SPL 抓取网页数据
- pandas使用fillna函数将dataframe中的缺失值按照列均值进行填充(fill missing values with the mean of the column)