GoLang 安装设置代理

在下载Gin时

go install github.com/gin-gonic/gin@latest

 

提示如下:

go: github.com/gin-gonic/gin@latest: module github.com/gin-gonic/gin: Get "https://proxy.golang.org/github.com/gin-gonic/gin/@v/list": dial tcp xxx.xxx.xxx.xxx:xxx: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

 

就是国内下载不了,需要配置全局镜像包的地址,配置之后就好了

go env -w GO111MODULE=on

go env -w GOPROXY=https://goproxy.cn,direct

posted @ 2024-01-23 10:03  CFFIRM  阅读(189)  评论(0编辑  收藏  举报