Go解决依赖报错

Go同步依赖时报错:

module github.com/astaxie/beego: Get "https://proxy.golang.org/github.com/astaxie/beego/@v/list": dial tcp 216.58.200.49:443: 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.

 原因是golang使用了默认的代理源:https://proxy.golang.org,而该代理源无法访问,所以造成了无法同步依赖

解决办法:

windows下控制台输入:

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

  

posted @ 2021-06-28 17:36  杯中的画  阅读(354)  评论(0)    收藏  举报