当前位置:网站首页>Error in go mode tidy go warning “all” matched no packages
Error in go mode tidy go warning “all” matched no packages
2022-07-31 00:22:00 【web15286201346】

Possible reasons found:
1. The local go compiler version
2. The go module build mode is not enabled
3. Is it in the directory where go.mod is located?Executed go mod tidy
Parse
When it was first released, there was no package management when go was released.
The go get command will obtain and save the corresponding module according to the path in $GOPATH/src
There is no concept of version,masterrepresents the stable version
Later, the Go Module was introduced in GO1.11, and there is no longer only one version. Use go.mod to record the version of each packageSo here comes the problem
Do you follow the rules of $GOPATH or follow the Go Module?
GO111MODULE is an environment variable used to change the way go imports packages
Go1.11 and Go1.12
- GO111MODULE=on
This setting will force the use of Go modules, even if the project is in your GOPATH.Requires go.mod to work.- GO111MOUDLE=off, use GOPATH way, even outside GOPATH
- GO111MODULE=auto, the default setting.
When you are not in the GOPATH, like GO111MODULE=on
When you are in GOPATH, even if there is go.mod, it is the effect of GO111MODULE=off
When you are in GOPATH and you need GO modules to do something (like go get a specific version), then do this:
GO111MODULE=on go getxxxxxGo 1.13, the meaning of auto has changed: if go.mod is found, or if there is no go.mod, but outside the GOPATH, then the effect is GO111MODULE=on (force to use go module).So you can keep all repositories in your GOPATH
why
When there is no go.mod, in the GOPATH, the effect is GO111MODULE=off (get the package and put it in $GOPATH/src/)
Check
1. Local go compiler version
Project version is 1.16, here go.mod defaults to GO111MODULE=on
2.go module build mode is not enabled
Just to be on the safe side
win
set GO111MODULE=autolinux
export GO111MODULE=autoIt didn't work
3. Whether to execute go mod tidy in the directory where go.mod is located
Finding is the third reason
should be inExecuted under douyinService instead of DouYin
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
- PHP图片添加文字水印
- VSCode高效开源神器有哪些
- Regular expression password policy and regular backtracking mechanism bypass
- 封装、获取系统用户信息、角色及权限控制
- MySQL数据库面试题总结(2022最新版)
- How to import game archives in joiplay emulator
- Steven Giesel 最近发布了一个由5部分内容组成的系列,记录了他首次使用 Uno Platform 构建应用程序的经验。
- 机器学习1一回归模型(二)
- MySQL grant statements
- 宽客必备神器-AKShare
猜你喜欢

mysql主从复制及读写分离脚本-亲测可用

unity2D横版游戏教程4-物品收集以及物理材质
![[In-depth and easy-to-follow FPGA learning 15---------- Timing analysis basics]](/img/a9/4c7a703a36a244394b586bfb42ab6b.png)
[In-depth and easy-to-follow FPGA learning 15---------- Timing analysis basics]

2D Transform Module && Media Queries

Understand from the 11 common examples of judging equality of packaging types in the written test: packaging types, the principle of automatic boxing and unboxing, the timing of boxing and unboxing, a

DATA AI Summit 2022提及到的对 aggregate 的优化

How to solve types joiplay simulator does not support this game

In-depth understanding of the auto-increment operator from two error-prone written test questions

joiplay模拟器不支持此游戏类型怎么解决

【深入浅出玩转FPGA学习13-----------测试用例设计1】
随机推荐
firewalld
The difference between substring and substr in MySQL
【深入浅出玩转FPGA学习15----------时序分析基础】
XSS相关知识
MySQL的grant语句
Gabor滤波器学习笔记
Installation considerations for pytorch
【愚公系列】2022年07月 Go教学课程 017-分支结构之IF
MySQL数据库约束,表的设计
46.<list链表的举列>
Steven Giesel recently published a 5-part series documenting his first experience building an application with the Uno Platform.
WebServer流程讲解(注册模块)
IOT跨平台组件设计方案
Necessary artifacts - AKShare quants
牛客网刷题训练(四)
如何在WordPress网站上添加导航菜单
h264和h265解码上的区别
SereTOD2022 Track2代码剖析-面向半监督和强化学习的任务型对话系统挑战赛
Strict Mode for Databases
ELK部署脚本---亲测可用