win下Golang环境搭建笔记和包安装

1.下载Golang

https://studygolang.com/dl
我这下载的是msi版本
https://studygolang.com/dl/golang/go1.9.2.windows-amd64.msi

我的安装路径是 D:\soft\Go

2.配置系统环境变量 GOROOT,就是安装路径

这里写图片描述

2.1 添加到path

%GOROOT%\bin

3.配置 GOPATH,就是你的项目理解,如果有多个项目用分号 ; 分隔

这里写图片描述

4. Vscode安装go插件

这里写图片描述

5. win下安装Golang需要的包,需要科学上网

5.1 Vscode里cmd设置http_proxy

命令在这

set http_proxy=http://127.0.0.1:1080

这里写图片描述

5.2 设置github代理

git config --global http.proxy http://127.0.0.1:1080 
git config --global https.proxy https://127.0.0.1:1080

默认不设置代理:

git config --global --unset http.proxy 
git config --global --unset https.proxy

查看已经设置的值:

git config http.proxy

6. mac下安装Golang需要的包,需要科学上网

root@ed27c545f7af:~# cat ~/proxy.conf 
export http_proxy=http://127.0.0.1:1080
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"

7. 附上常用的包

https://studygolang.com/articles/2516

最后附上参考文章地址 https://studygolang.com/articles/5690

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值