macOS & Linux:

export GO111MODULE=on 
export GOPROXY=https://goproxy.cn

Windows

$env:GO111MODULE = "on"
$env:GOPROXY = "<https://goproxy.cn>"