go编译报错https://proxy.golang.org/github.com/ i/o timeout
作者:互联网
报错信息
go build go: github.com/docopt/docopt-go@v0.0.0-20180111231733-ee0de3bc6815: Get https://proxy.golang.org/github.com/docopt/docopt-go/@v/v0.0.0-20180111231733-ee0de3bc6815.mod: dial tcp 142.251.42.241:443: i/o timeout
解决方法
go env -w GOPROXY=https://goproxy.cn,direct
成功执行日志
devuser@ubuntu2004:~/CLionProjects/snmp-mqtt$ go build go: github.com/docopt/docopt-go@v0.0.0-20180111231733-ee0de3bc6815: Get https://proxy.golang.org/github.com/docopt/docopt-go/@v/v0.0.0-20180111231733-ee0de3bc6815.mod: dial tcp 142.251.42.241:443: i/o timeout devuser@ubuntu2004:~/CLionProjects/snmp-mqtt$ go env -w GOPROXY=https://goproxy.cn,direct devuser@ubuntu2004:~/CLionProjects/snmp-mqtt$ go build go: downloading github.com/eclipse/paho.mqtt.golang v1.2.0 go: downloading github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 go: extracting github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 go: extracting github.com/eclipse/paho.mqtt.golang v1.2.0 go: downloading github.com/soniah/gosnmp v1.22.0 go: extracting github.com/soniah/gosnmp v1.22.0 go: downloading github.com/golang/mock v1.2.0 go: downloading golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582 go: extracting github.com/golang/mock v1.2.0 go: extracting golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582 go: finding github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 go: finding github.com/eclipse/paho.mqtt.golang v1.2.0 go: finding github.com/soniah/gosnmp v1.22.0 go: finding golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582 go: finding github.com/golang/mock v1.2.0
参考来源:
https://blog.csdn.net/leyangjun/article/details/124467683
https://blog.csdn.net/nlcexiyue/article/details/121098353
标签:github,v0.0,golang,报错,timeout,go,docopt,com 来源: https://www.cnblogs.com/passedbylove/p/16387890.html