文章目录

  • GO使用`go get -u "包"`下载github.com包报错
  • 报错(被墙了,需要使用代理):
  • 修改 `go env配置`(下面使用七牛云代理)
    • macOS 或 Linux
    • Windows
  • `最后`

fatal: unable to access 'https://github.com/gin-gonic/gin/': Failed to connect to

GO使用go get -u "包"下载github.com包报错

报错(被墙了,需要使用代理):

fatal: unable to access 'https://github.com/gin-gonic/gin/': Failed to connect to github.com port 443 after 75069 ms: Operation timed out
package github.com/gin-gonic/gin: exit status 1

修改 go env配置(下面使用七牛云代理)

Go 1.13 及以上(推荐)
打开你的终端并执行

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

macOS 或 Linux

打开你的终端并执行

export GO111MODULE=on
export GOPROXY=https://goproxy.cn
或者echo "export GO111MODULE=on" >> ~/.profile
echo "export GOPROXY=https://goproxy.cn" >> ~/.profile
source ~/.profile

Windows

打开你的 PowerShell 并执行

C:\> $env:GO111MODULE = "on"
C:\> $env:GOPROXY = "https://goproxy.cn"

或者

  1. 打开“开始”并搜索“env”
  2. 选择“编辑系统环境变量”
  3. 点击“环境变量…”按钮
  4. 在“<你的用户名> 的用户变量”章节下(上半部分)
  5. 点击“新建…”按钮
  6. 选择“变量名”输入框并输入“GO111MODULE”
  7. 选择“变量值”输入框并输入“on”
  8. 点击“确定”按钮
  9. 点击“新建…”按钮
  10. 选择“变量名”输入框并输入“GOPROXY”
  11. 选择“变量值”输入框并输入“https://goproxy.cn”
  12. 点击“确定”按钮

最后

切记GO111MODULEGOPROXY两个都要修改
下面是我的配置(Mac M1)可以参考一下

GO111MODULE="on"
GOARCH="arm64"
GOBIN="/Users/allen/go/bin"
GOCACHE="/Users/allen/Library/Caches/go-build"
GOENV="/Users/allen/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/allen/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/allen/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn"
GOROOT="/usr/local/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.17.7"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="0"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/22/4s8ptnhd57520jyj50vy_k5c0000gn/T/go-build4187962071=/tmp/go-build -gno-record-gcc-switches -fno-common"

GO使用go get -u “包“: fatal: unable to access ‘https://github.com/..‘: Failed to connect to报错相关推荐

  1. fatal: unable to access ‘https://github.comxxxxxxxxxxx‘: Failed to connect to xxxxxxxxxxxxx

    git clone 遇到问题:fatal: unable to access 'https://github.comxxxxxxxxxxx': Failed to connect to xxxxxxx ...

  2. git clone 遇到问题:fatal: unable to access ‘https://github.comxxxxxxxxxxx‘: Failed to connect to xxxxxxx

    git clone 遇到问题:fatal: unable to access 'https://github.comxxxxxxxxxxx': Failed to connect to xxxxxxx ...

  3. 解决GitHub连不上的问题fatal: unable to access ‘https://github.com/..’: Failed to connect to github.com port

    解决GitHub连不上的问题 fatal: unable to access 'https://github.com/dmlc/dgl.git': Failed to connect to githu ...

  4. 解决 Push failed: Unable to access 'https://github.com/...': Failed to connect ...Connection Refused

    解决 Push failed: Unable to access 'https://github.com/-': Failed to connect to 127.0.0.1 port xxx Con ...

  5. Push failed Unable to access ‘https://github.com/‘: Failed to connect to github.com port 443: Timed

    GitHub推送到远程仓库报错: Push failed Unable to access 'https://github.com/': Failed to connect to github.com ...

  6. 解决github unable to access ‘https://github.com/...: Failed to connect to github.com port 443

    当我们使用git clone下载仓库代码的时候,出现github unable to access 'https://github.com/...: Failed to connect to gith ...

  7. github unable to access 'https://github.com/...: Failed to connect to github.com port 443‘

    建立一个github帐号(pythonsoft)之后,按照提示create a repository: test. 想把这个项目clone到本地: git clone https://github.c ...

  8. centos 低版本出现fatal: unable to access 'https://github.com/XXXX': SSL connect error

    yum update nss 把openssl更新到最新版本 搞定 转载于:https://www.cnblogs.com/huhu1203/p/9041986.html

  9. git clone 出现fatal: unable to access ‘https://github 类错误解决方法

    git clone 遇到问题:fatal: unable to access 'https://github.comxxxxxxxxxxx': Failed to connect to xxxxxxx ...

最新文章

  1. 标签选择器用于修改html元素默认的样式,html – 为什么CSS选择器与 sign(直接子)覆盖默认样式?...
  2. 设计模式:访问者(Visitor)模式
  3. 蓝牙4.0技术分析1-广播者角色
  4. 会了这些命令,还怕搞不定思科设备?
  5. 2022年全球及中国面粉加工机械行业竞争现状与发展前景规模分析报告
  6. CentOS7.5下时间戳转换为时间
  7. 计算机二级python选择题题库_2018年计算机二级python题库精编(1)
  8. 这是我见过最通俗易懂的单例模式讲解了!
  9. js截屏代码_服务端浏览器截屏
  10. 80211n标准建链速率计算
  11. vue 静态资源文件夹src下的assets 和static的区别
  12. 2.tcpdump(2)
  13. Excel宏教程 (宏的介绍与基本使用)
  14. vue开发很难?不存在的,可视化开发神器mxdev0.4版更新
  15. Python 玩转数据 12 - 数据读写 Data I/O: Pandas 读写 JSON File Format
  16. 小米路由器的服务器无响应怎么回事啊,小米路由器常见故障处理方法
  17. GPIOA高8位输入控制低8位输出(位运算)
  18. Android下红包雨的实现
  19. 什么品牌的蓝牙耳机音质最好?高品质蓝牙耳机排行榜
  20. 微信公众号历史消息栏设置

热门文章

  1. unity开发 斗地主算法—提示AI(提示出牌)
  2. 如何在你的CSDN 博客中添加广告代码(网赚)
  3. tp5下delete()方法
  4. html 输入框键盘遮挡,解决输入框被键盘挡住的问题
  5. 你的网站友情链接是全站友情链接吗
  6. 详解Unity中的Nav Mesh新特性|导航寻路系统 (二)
  7. python canopen_CAN与CANOPEN在电机控制中的应用
  8. 国产FPGA智多晶烧写SA5Z系列SoC FPGA FLASH烧写错误解决
  9. Xampp下载及使用
  10. 六十星系之29武曲独坐辰戌