以windows为例,
在cmd 窗口中执行下列语句
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct
或者
1.运行 go env -w GO111MODULE=on //开启mod
运行 go env -w GOPROXY=https://goproxy.cn,direct //设置代理
执行下载包例子
go get github.com/orcaman/concurrent-map
//也可以使用阿里的镜像
go env -w GOPROXY=https://mirrors.aliyun.com/goproxy,direct
go get github.com/orcaman/concurrent-map