当前位置:网站首页>golang 设置goproxy代理的小细节,适用于go module下载超时,阿里云镜像go module下载超时
golang 设置goproxy代理的小细节,适用于go module下载超时,阿里云镜像go module下载超时
2022-07-04 12:33:00 【深夜听表】
问题
前几天好奇加了个国内那种联盟链区块链官方社区群,然后有个人编译一个工具时go module下载一直超时,之后就用了阿里云的镜像,命令看上去没什么问题如下,但是还是一直超时。
验证
可是我这边清理module缓存,验证阿里云镜像确实挂了,但是换了其他镜像代理是正常的,这就离谱了。
分析原因与解决办法
那么原因肯定还是配置问题,所以我检查了一下那个人的bash命令,确实有问题,如下:
讲道理export命令在终端未关闭的情况下是一直有效的,但是他这里还有个细节不知道你有没有发现了,他滥用了sudo命令,他编译命令用了sudo make
,但是root用户要找的golang环境变量并没有修改,所以上一条export
命令等于是白输入了。
解决也很好解决,直接使用下面命令修改go env环境变量
go env -w GO111MODULE=on #-w 表示修改环境变量的默认值
go env -w GOPROXY=https://goproxy.io,direct
修改完使用go env
命令检查一遍是否改好了,最后make
搞定。
不得不说装逼的感觉真爽:)
🥰如果喜欢你也可以请我喝果汁🥰
打赏 / Donate
边栏推荐
- Play Sanzi chess easily
- DC-5靶机
- C语言:求100-999是7的倍数的回文数
- A few words explain redis cache penetration, breakdown, avalanche, and redis sentinel
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 22
- [the way of programmer training] - 2 Perfect number calculation
- Memory computing integration: AI chip architecture in the post Moorish Era
- Lecture 9
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
猜你喜欢
vim 出现 Another program may be editing the same file. If this is the case 的解决方法
It's hard to hear C language? Why don't you take a look at this (V) pointer
Experiment 7. IPv6
Source code analysis of the implementation mechanism of multisets in guava class library
R language -- readr package reads and writes data
When synchronized encounters this thing, there is a big hole, pay attention!
Tableau makes data summary after linking the database, and summary exceptions occasionally occur.
Servlet learning notes
13、 C window form technology and basic controls (3)
Paper notes ACL 2020 improving event detection via open domain trigger knowledge
随机推荐
Interview question MySQL transaction (TCL) isolation (four characteristics)
17. Memory partition and paging
C語言:求100-999是7的倍數的回文數
[ES6] template string: `string`, a new symbol in es2015
mm_ Cognition of struct structure
DC-5 target
Lecture 9
Map container
Entitas learning [iv] other common knowledge points
VBA, JSON interpretation, table structure -json string conversion
It's hard to hear C language? Why don't you take a look at this (V) pointer
Global and Chinese market of piston rod 2022-2028: Research Report on technology, participants, trends, market size and share
C语言:围圈报号排序问题
Global and Chinese markets for environmental disinfection robots 2022-2028: Research Report on technology, participants, trends, market size and share
In 2022, financial products are not guaranteed?
昨天的事情想说一下
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8
Bottom Logic -- Mind Map
MYCAT middleware installation and use
priority_ queue