go插件 vscode 报错_MacOS中 VSCode 安装 GO 插件失败问题的快速解决方法
问题重现
Installing golang.org/x/tools/cmd/guru FAILED
Installing golang.org/x/tools/cmd/gorename FAILED
Installing golang.org/x/lint/golint FAILED
Installing github.com/stamblerre/gocode FAILED
4 tools failed to install.
VS COde 打开 .go 文件会自动安装插件,但是出现了一些工具的下载失败。
换上全局代理也无法下载。
找了许多教程,但可能由于一些版本的问题,目录已经变更了,导致吾卡在这里许久。尤其是 github.com/stamblerre/gocode。
解决
下面的操作都是基于 $GOPATH 这个路径下,MacOS 中 go 的 $GOPATH 可以通过在终端键入go env查看 $GOPATH 位置。
吾的 $GOPATH 位置在/Users/Apple/go,注意要切换到你自己的 $GOPATH 中。
1、创建目录golang.org\x,并进入该目录中 clone 工具仓库。
$ cd /Users/Apple/go/src
$ mkdir -p golang.org/x && cd golang.org/x
$ git clone https://github.com/golang/tools.git tools
$ git clone https://github.com/golang/lint.git
$ ls
lint tools
2、回到 $GOPATH 目录,安装插件
$ cd /Users/Apple/go
$ sudo go install golang.org/x/tools/cmd/guru
$ sudo go install golang.org/x/tools/cmd/gorename
$ sudo go install golang.org/x/lint/golint
3、创建目录github.com,并进入该目录中 clone 工具仓库。
$ cd /Users/Apple/go/src
$ sudo mkdir -p github.com/stamblerre $$ cd github.com/stamblerre
$ sudo git clone https://github.com/stamblerre/gocode.git
$ ls
gocode
4、回到 $GOPATH 目录,安装插件
$ cd /Users/Apple/go
$ sudo go install github.com/stamblerre/gocode
四个插件都安装完成之后,再用 VS Code 打开随意一个 .go 文件 ,就不会报安装失败的错误了。
总结
到此这篇关于MacOS中 VSCode 安装 GO 插件失败问题的快速解决方法的文章就介绍到这了,更多相关VSCode 安装 GO 插件失败内容请搜索我们以前的文章或继续浏览下面的相关文章希望大家以后多多支持我们!
本文标题: MacOS中 VSCode 安装 GO 插件失败问题的快速解决方法
本文地址: http://www.cppcns.com/jiaoben/golang/312328.html
go插件 vscode 报错_MacOS中 VSCode 安装 GO 插件失败问题的快速解决方法相关推荐
- python3导入ssl报错_python3中pip3安装出错,找不到SSL的解决方式
最近在Ubuntu16.04上安装Python3.6之后,使用pip命令出现了问题,提示说找不到ssl模块,出现错误如下: pip is configured with locations that ...
- ENVI IDL报错:An error has occurred. See the log file快速解决方法
今天下午用ENVI的时候,突然出现了这个报错: 然后搜了一下"an error has occured. see the log file",出现了一些不太相关的解决方法,没什么用 ...
- 【Keil MDK中工程报错Browse information of one of more files is not available解决方法】
[Keil MDK中工程报错Browse information of one of more files is not available解决方法] 今天在进行工程编写时,出现了这个错误Browse ...
- python3运行报错:TypeError: Object of type ‘type‘ is not JSON serializable解决方法(详细)
python3运行报错:TypeError: Object of type 'type' is not JSON serializable解决方法(详细) 参考文章: (1)python3运行报错:T ...
- nodejs连接mysql数据库,报错Client does not support authentication protocol requested by server的解决方法
nodejs连接mysql数据库,报错Client does not support authentication protocol requested by server的解决方法 参考文章: (1 ...
- MyBatis多个接口参数报错:Available parameters are [0, 1, param1, param2], 及解决方法
MyBatis多个接口参数报错:Available parameters are [0, 1, param1, param2], 及解决方法 参考文章: (1)MyBatis多个接口参数报错:Avai ...
- 安装thinkphp 报错Could not find package topthink/think with stability stable.的解决方法
安装thinkphp执行命令 composer create-project topthink/think tp5 --prefer-dist 报错 [InvalidArgumentException ...
- MySQL无法启用/etc/my.cnf配置文件,重启报错Warning: World-writable config file ‘/etc/my.cnf’ is ignored的解决方法
MySQL无法启用/etc/my.cnf配置文件,重启报错Warning: World-writable config file '/etc/my.cnf' is ignored的解决方法 问题分析 ...
- 【Git】Git commit至Gitee报错‘remote: error: hook declined to update refs/heads/master‘的解决方法
Git commit至Gitee报错'remote: error: hook declined to update refs/heads/master'的解决方法 进入到Gitee的邮箱管理中,取消勾 ...
最新文章
- 性能测试学习过程中遇到的问题与解答1
- 【前端】纯前端的一个‘喜欢我吗?’
- python根据二叉树的前序遍历和中序遍结果历重建二叉树
- 不可错过!普渡大学最新《机器学习》课程
- 设置tomcat的默认jdk
- 【Spring框架家族】mybatis generator代码自动生成(看得上眼直接拿去用即可)
- 如何去掉手机php,dedecms怎么关闭手机版
- 【PP操作手册】创建公司间交易采购订单
- Content Security Policy 入门教程
- leetcode题解776-旋转字符串
- python实践项目(九)
- 自动滑动的banner图
- 手把手教你使用SPSS做出亚组分析的交互作用效应(p for Interaction)
- 从Thompson Sampling到增强学习, 再谈多臂老虎机问题
- web前端的css示例
- 2017年问题汇总-待整理
- Dynamic SQL(动态SQL)
- [学习笔记]Python for Data Analysis, 3E-11.时间序列
- 舒舍宿舍:来自4年的北漂合租辛酸经验
- LSTM之父发文:我眼中的深度学习十年简史!