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