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

边栏推荐
- R语言--readr包读写数据
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19
- Introduction to random and threadlocalrandom analysis
- C language function
- How to realize the function of Sub Ledger of applet?
- Azure solution: how can third-party tools call azure blob storage to store data?
- Exness: positive I win, negative you lose
- MYCAT middleware installation and use
- Uva536 binary tree reconstruction tree recovery
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
猜你喜欢

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

Review of week 278 of leetcode II

Bottom Logic -- Mind Map

《天天数学》连载57:二月二十六日
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20](/img/d5/4bce239b522696b5312b1346336b5f.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20

C fonctions linguistiques

MySQL performance optimization index

Fly tutorial 02 advanced functions of elevatedbutton (tutorial includes source code) (tutorial includes source code)

When synchronized encounters this thing, there is a big hole, pay attention!

Detailed explanation of NPM installation and caching mechanism
随机推荐
记一次 Showing Recent Errors Only Command /bin/sh failed with exit code 1 问题
[Yu Yue education] 233 pre school children's language education reference questions in the spring of 2019 of the National Open University
Interview question MySQL transaction (TCL) isolation (four characteristics)
Introduction to the button control elevatedbutton of the fleet tutorial (the tutorial includes the source code)
First knowledge of spark - 7000 words +15 diagrams, and learn the basic knowledge of spark
I want to talk about yesterday
AI should take code agriculture? Deepmind offers a programming version of "Alpha dog" alphacode that surpasses nearly half of programmers!
MySQL advanced review
The detailed installation process of Ninja security penetration system (Ninjitsu OS V3). Both old and new VM versions can be installed through personal testing, with download sources
R语言--readr包读写数据
Global and Chinese market for naval vessel maintenance 2022-2028: Research Report on technology, participants, trends, market size and share
C language: find the length of string
[ES6] template string: `string`, a new symbol in es2015
Iframe to only show a certain part of the page
Source code analysis of the implementation mechanism of multisets in guava class library
Article download address
ASP. Net razor – introduction to VB loops and arrays
03_ Armv8 instruction set introduction load and store instructions
ArgMiner:一个用于对论点挖掘数据集进行处理、增强、训练和推理的 PyTorch 的包
It's hard to hear C language? Why don't you take a look at this (V) pointer