当前位置:网站首页>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

边栏推荐
- Global and Chinese markets for soluble suture 2022-2028: Research Report on technology, participants, trends, market size and share
- Paper notes ACL 2020 improving event detection via open domain trigger knowledge
- 01. Basics - MySQL overview
- Communication tutorial | overview of the first, second and third generation can bus
- How to disable debug messages on sockjs stomp - how to disable debug messages on sockjs Stomp
- Exness: positive I win, negative you lose
- Global and Chinese markets of digital PCR and real-time PCR 2022-2028: Research Report on technology, participants, trends, market size and share
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 11
- IIS error, unable to start debugging on the webserver
- Leetcode day 17
猜你喜欢

LVS load balancing cluster deployment - Dr direct routing mode

Flet教程之 02 ElevatedButton高级功能(教程含源码)(教程含源码)

C fonctions linguistiques

MySQL performance optimization index
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14](/img/c5/dde92f887e8e73d7db869fcddc107f.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14

Argminer: a pytorch package for processing, enhancing, training, and reasoning argument mining datasets
![[the way of programmer training] - 2 Perfect number calculation](/img/fd/4bb8560f601daddaa8895f20215be4.jpg)
[the way of programmer training] - 2 Perfect number calculation

Method of setting default items in C # ComboBox control code

Jetson TX2配置Tensorflow、Pytorch等常用库

Introduction to the button control elevatedbutton of the fleet tutorial (the tutorial includes the source code)
随机推荐
Map container
Paper notes ACL 2020 improving event detection via open domain trigger knowledge
MySQL performance optimization index
Lecture 9
03_ Armv8 instruction set introduction load and store instructions
[notes] streamingassets
Global and Chinese markets of digital PCR and real-time PCR 2022-2028: Research Report on technology, participants, trends, market size and share
Openssl3.0 learning 20 provider KDF
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 21
[Chongqing Guangdong education] National Open University spring 2019 2727 tax basis reference questions
Haproxy cluster
昨天的事情想说一下
IPv6 experiment
16. Memory usage and segmentation
Data communication and network: ch13 Ethernet
MPLS experiment
It's hard to hear C language? Why don't you take a look at this (V) pointer
【数据聚类】第四章第一节3:DBSCAN性能分析、优缺点和参数选择方法
2022, 6G is heating up
Global and Chinese market of dental elevators 2022-2028: Research Report on technology, participants, trends, market size and share