Go

2019-09-11

WSL2编译inlets过程

1.安装go

apt install golang-go

2.配置go代理

echo "export GO111MODULE=on" >> ~/.profile
echo "export GOPROXY=https://goproxy.cn" >> ~/.profile
source ~/.profile

3.下载安装源码

go get -u github.com/inlets/inlets-archived
cd $GOPATH/src/github.com/inlets/inlets-archived

4.开始编译

Linux:

go build

windows:

CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build

便捷的多版本go 环境的管理和切换

Windows

https://github.com/voidint/g

Linux

https://github.com/moovweb/gvm

国内不能go get处理办法

推荐使用七牛团队发布的代理模块:https://github.com/goproxy/goproxy.cn

其他代理模块

https://github.com/golang/go/wiki/Modules#are-there-always-on-module-repositories-and-enterprise-proxies

GO在线教程:https://github.com/astaxie/build-web-application-with-golang/blob/master/zh/preface.md