[Golang]-9 Go Bulid 打包报错:A connection attempt failed……解决方法

目录

现象

打包出现下面的错误

go build

go: github.com/auth0/go-jwt-middleware@v0.0.0-20190805220309-36081240882b: Get "https://proxy.golang.org/github.com/auth0/go-jwt-middleware/@v/v0.0.0-20190805220309-36081240882b.mod": dial tcp 216.58.200.241: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.

原因

go.mod 代理连接出错

解决方法

go.mod 设置代理

golang1.13.x 在命令行中可以直接执行:

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

相关文章

类型转换 1、int转string 2、string转int 3、string转float ...
package main import s "strings" import...
类使用:实现一个people中有一个sayhi的方法调用功能,代码如...
html代码: beego代码:
1、读取文件信息: 2、读取文件夹下的所有文件: 3、写入文件...
配置环境:Windows7+推荐IDE:LiteIDEGO下载地址:http:...