GO使用go get -u “包“: fatal: unable to access ‘https://github.com/..‘: Failed to connect to报错
文章目录
- 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"
或者
- 打开“开始”并搜索“env”
- 选择“编辑系统环境变量”
- 点击“环境变量…”按钮
- 在“<你的用户名> 的用户变量”章节下(上半部分)
- 点击“新建…”按钮
- 选择“变量名”输入框并输入“GO111MODULE”
- 选择“变量值”输入框并输入“on”
- 点击“确定”按钮
- 点击“新建…”按钮
- 选择“变量名”输入框并输入“GOPROXY”
- 选择“变量值”输入框并输入“https://goproxy.cn”
- 点击“确定”按钮
最后
切记GO111MODULE
、GOPROXY
两个都要修改
下面是我的配置(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报错相关推荐
- 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 ...
- 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 ...
- 解决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 ...
- 解决 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 ...
- 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 ...
- 解决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 ...
- 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 ...
- centos 低版本出现fatal: unable to access 'https://github.com/XXXX': SSL connect error
yum update nss 把openssl更新到最新版本 搞定 转载于:https://www.cnblogs.com/huhu1203/p/9041986.html
- git clone 出现fatal: unable to access ‘https://github 类错误解决方法
git clone 遇到问题:fatal: unable to access 'https://github.comxxxxxxxxxxx': Failed to connect to xxxxxxx ...
最新文章
- 标签选择器用于修改html元素默认的样式,html – 为什么CSS选择器与 sign(直接子)覆盖默认样式?...
- 设计模式:访问者(Visitor)模式
- 蓝牙4.0技术分析1-广播者角色
- 会了这些命令,还怕搞不定思科设备?
- 2022年全球及中国面粉加工机械行业竞争现状与发展前景规模分析报告
- CentOS7.5下时间戳转换为时间
- 计算机二级python选择题题库_2018年计算机二级python题库精编(1)
- 这是我见过最通俗易懂的单例模式讲解了!
- js截屏代码_服务端浏览器截屏
- 80211n标准建链速率计算
- vue 静态资源文件夹src下的assets 和static的区别
- 2.tcpdump(2)
- Excel宏教程 (宏的介绍与基本使用)
- vue开发很难?不存在的,可视化开发神器mxdev0.4版更新
- Python 玩转数据 12 - 数据读写 Data I/O: Pandas 读写 JSON File Format
- 小米路由器的服务器无响应怎么回事啊,小米路由器常见故障处理方法
- GPIOA高8位输入控制低8位输出(位运算)
- Android下红包雨的实现
- 什么品牌的蓝牙耳机音质最好?高品质蓝牙耳机排行榜
- 微信公众号历史消息栏设置