go build: mod: x509: certificate has expired or is not yet valid
今天在編譯go程序是出現報錯:
go: github.com/buger/[email protected]: Get https://goproxy.io/github.com/buger/jsonparser/@v/v0.0.0-20181115193947-bf1c66bbce23.mod: x509: certificate has expired or is not yet valid
make[1]: *** [static] Error 1
make[1]: Leaving directory `/home/sme/smedia'
make: *** [_] Error 2
x509: certificate has expired or is not yet valid
當前用的 GOPROXY 是:
[sme@eb3512 smedia]$ go env | grep GOPROXY
GOPROXY="https://goproxy.io"
其實換個 GOPROXY 就可以解決了:
[sme@eb3512 smedia]$ export GOPROXY=https://goproxy.cn
[sme@eb3512 smedia]$ go env | grep GOPROXY
GOPROXY="https://goproxy.cn"
參考:
1.https://goproxy.cn/