go env -w GOFLAGS=-buildvcs=false
在 Linux 或 macOS 上面
需要运行下面命令(或者,可以把以下命令写到 .bashrc 或 .bash_profile 文件中):
| |
|
| |
go env -w GO111MODULE=on |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
go env -w GOPROXY=https://goproxy.cn,direct |
| |
|
| |
|
| |
|
| |
go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct |
| |
|
| |
|
| |
|
| |
go env -w GOPROXY=https://goproxy.io,direct |
| |
|
| |
|
| |
$ go env | grep GOPROXY |
| |
GOPROXY="[https://goproxy.cn](https://goproxy.cn/)" |
在Windows上面
| |
|
| |
$env:GO111MODULE="on" |
| |
|
| |
|
| |
|
| |
|
| |
$env:GOPROXY="https://goproxy.cn,direct" |
| |
|
| |
|
| |
$env:GOPROXY="https://mirrors.aliyun.com/goproxy/,direct" |
| |
|
| |
|
| |
$env:GOPROXY="https://goproxy.io,direct" |
| |
|
| |
|
| |
$ go env | grep GOPROXY |
| |
GOPROXY="[https://goproxy.cn](https://goproxy.cn/)" |