go mod tidy报错connection refused

报错内容:

之前都正常,新建项目后突然有这报错。

xjj@linuxmint01:~/goprojects/gorpcserver$ go mod tidy
go: finding module for package github.com/forgoer/openssl
go: finding module for package github.com/go-resty/resty/v2
go: downloading github.com/go-resty/resty/v2 v2.7.0
go: downloading github.com/go-resty/resty v1.12.0
go: downloading github.com/forgoer/openssl v1.1.1
go: finding module for package github.com/jinzhu/gorm
go: finding module for package github.com/jinzhu/gorm/dialects/mysql
go: found github.com/jinzhu/gorm in github.com/jinzhu/gorm v1.9.16
go: found github.com/jinzhu/gorm/dialects/mysql in github.com/jinzhu/gorm v1.9.16
go: finding module for package github.com/forgoer/openssl
go: finding module for package github.com/go-resty/resty/v2
gorpcserver/api imports
        github.com/forgoer/openssl: github.com/forgoer/[email protected]: verifying module: github.com/forgoer/[email protected]: Get "https://sum.golang.org/lookup/github.com/forgoer/[email protected]": dial tcp 216.58.200.49:443: connect: connection refused
gorpcserver/api imports
        github.com/go-resty/resty/v2: github.com/go-resty/resty/[email protected]: verifying module: github.com/go-resty/resty/[email protected]: Get "https://sum.golang.org/lookup/github.com/go-resty/resty/[email protected]": dial tcp 216.58.200.49:443: connect: connection refused


解决方案

重新设置了一遍校验服务的地址

go env -w GOSUMDB=off
go env -w GOSUMDB="sum.golang.google.cn"

然后执行命令go mod tidy就成功了

你可能感兴趣的:(go)