go get connectex: A connection attempt failed because the connected party did not properly respond

本文解决了一个Go语言在获取依赖包时遇到的连接超时问题。通过配置代理服务器(如七牛提供的goproxy.cn),成功绕过了网络限制,实现了依赖包的正常下载。

今天 go get 时出现了截图中的这个问题:
在这里插入图片描述

go: finding module for package github.com/Sirupsen/logrus
csphere-test/my-log imports
        github.com/Sirupsen/logrus: module github.com/Sirupsen/logrus: Get "https://proxy.golang.org/github.com/%21sirupsen/logrus/@v/list": dial tcp 172.217.160.81: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 GOPROXY=https://goproxy.cn

在这里插入图片描述

评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值