ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Go语言学习过程记录

2021-11-20 09:07:09  阅读:212  来源: 互联网

标签:files bin 语言 SUCCEEDED 记录 Installing program Go


1. 使用VS Code安装GO环境

        百度下载go安装包安装之后,比如我本地是安装在D:\program files\Go目录,此时需要将系统的环境变量更改为此目录,因为环境变量中默认填写的是C:\Users\Administrator\go,但是这个目录下并没有什么东西,导致在VS中运行的时候会报错。修改之后没生效可以试试重启电脑。

        第一次运行的时候VS会提示下载GO的插件,默认的proxy设置是

GOPROXY=https://proxy.golang.org/

但是这个地址国内访问有问题,下载的时候会报错如:

Installing github.com/fatih/gomodifytags@latest FAILED

所以需要修改为:

GOPROXY=https://goproxy.io/

在windows的命令行中(cmd)进行修改,修改使用的命令为:

go env -w GOPROXY=https://goproxy.io/,direct

修改完成之后重启VS即可正常下载插件了,插件安装成功之后有如下提示:

Tools environment: GOPATH=D:\program files\Go
Installing 10 tools at D:\program files\Go\bin in module mode.
  gopkgs
  go-outline
  gotests
  gomodifytags
  impl
  goplay
  dlv
  dlv-dap
  staticcheck
  gopls

Installing github.com/uudashr/gopkgs/v2/cmd/gopkgs@latest (D:\program files\Go\bin\gopkgs.exe) SUCCEEDED
Installing github.com/ramya-rao-a/go-outline@latest (D:\program files\Go\bin\go-outline.exe) SUCCEEDED
Installing github.com/cweill/gotests/gotests@latest (D:\program files\Go\bin\gotests.exe) SUCCEEDED
Installing github.com/fatih/gomodifytags@latest (D:\program files\Go\bin\gomodifytags.exe) SUCCEEDED
Installing github.com/josharian/impl@latest (D:\program files\Go\bin\impl.exe) SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay@latest (D:\program files\Go\bin\goplay.exe) SUCCEEDED
Installing github.com/go-delve/delve/cmd/dlv@latest (D:\program files\Go\bin\dlv.exe) SUCCEEDED
Installing github.com/go-delve/delve/cmd/dlv@master (D:\program files\Go\bin\dlv-dap.exe) SUCCEEDED
Installing honnef.co/go/tools/cmd/staticcheck@latest (D:\program files\Go\bin\staticcheck.exe) SUCCEEDED
Installing golang.org/x/tools/gopls@latest (D:\program files\Go\bin\gopls.exe) SUCCEEDED

All tools successfully installed. You are ready to Go. :)

标签:files,bin,语言,SUCCEEDED,记录,Installing,program,Go
来源: https://blog.csdn.net/xyh153996626/article/details/121434786

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有