General registry manager
Here are several great golang module registry, if you are in china, goproxy.io and goproxy.cn are recommended.
- Golang Official Registry
- Jfrog Gocenter
- Qiniu goproxy.cn
- goproxy.io
- Athens A Go module datastore and proxy
Go version >= 1.13 (RECOMMENDED)
go env -w GO111MODULE=on
go env -w GOPROXY="https://goproxy.io,direct"
# Set environment variable allow bypassing the proxy for selected modules (optional)
go env -w GOPRIVATE="*.corp.example.com"
Go version <= 1.12 Bash (Linux or macOS)
# Enable the go modules feature
export GO111MODULE="on"
# Set the GOPROXY environment variable
export GOPROXY="https://goproxy.io"
Or, write it into the .profile or .bash_profile file.
PowerShell (Windows)
# Enable the go modules feature
$env:GO111MODULE="on"
# Set the GOPROXY environment variable
$env:GOPROXY="https://goproxy.io"
Node.js developer can use nrm