go get -u 安装包失败

go get -u 安装包失败

执行 go get -u github.com/go-sql-driver/mysql ,出现

go: github.com/go-sql-driver/mysql@v1.6.0: Get “https://proxy.golang.org/github.com/go-sql-driver/mysql/@v/v1.6.0.mod”: dial tcp 142.251.43.17: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 env -w GOSUMDB=off

#引入需要的包

②go get -u github.com/go-sql-driver/mysql

留下回复