1.下载安装Go(可参考go的搭建)
http://c.biancheng.net/view/4773.html
2.下载安装Vscode(这里不多说,网上好多vscode的资料)
https://visualstudio.microsoft.com/zh-hans/
3.设置Go 参数
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
go env -w GOBIN=C:\Go\bin
配置完成查看配置:go evn
3.vscode安装go插件
4.安装完成后下载插件工具
按住Ctrl+Shift+P 输入Go:Install/Update Tools
全选后确定
如果出现错误:
1.检查配置有没有配错
2.在浏览器中打开下载地址:github.com/uudashr/gopkgs/v2/cmd/gopkgs ,查看是否能进去。如果不能进去就是github地址打开出错,可参考下面配置:
1)百度搜索’查询网址dns,或者’可以直接输入网址https://tool.chinaz.com/dns/
2)检测https://github.com得到响应IP,添加IP到hosts文件中
windows C:\Windows\System32\drivers\etc\hosts
方法一直接修改hosts文件,添加下面IP到文件中
13.250.177.223 github.com
52.69.186.44 github.com
3)再次打开github地址查看:github.com/uudashr/gopkgs/v2/cmd/gopkgs
4.安装完成结果展示
引用地址:
http://c.biancheng.net/view/4773.html