当前位置:网站首页>Go mode tidy reports an error go warning “all” matched no packages
Go mode tidy reports an error go warning “all” matched no packages
2022-07-31 21:11:00 【m0_67400972】

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 Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Ali 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
边栏推荐
- 使用 Flutter 和 Firebase 制作!计数器应用程序
- API for JD.com to obtain historical price information of commodities
- Carbon教程之 基本语法入门大全 (教程)
- Douyin fetches video list based on keywords API
- Apache EventMesh distributed event-driven multi-runtime
- Unity 之 音频类型和编码格式介绍
- Thymeleaf是什么?该如何使用。
- How programmers learn open source projects, this article tells you
- A shortcut to search for specific character content in idea
- 高通cDSP简单编程例子(实现查询高通cDSP使用率、签名),RK3588 npu使用率查询
猜你喜欢

Redis Overview: Talk to the interviewer all night long about Redis caching, persistence, elimination mechanism, sentinel, and the underlying principles of clusters!...

Chapter Six

A shortcut to search for specific character content in idea

Shell script quick start to actual combat -02
![[Intensive reading of the paper] iNeRF](/img/a7/910667911e1ce8996b9d22de63ea04.png)
[Intensive reading of the paper] iNeRF

顺序表的实现
![[Open class preview]: Research and application of super-resolution technology in the field of video image quality enhancement](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[Open class preview]: Research and application of super-resolution technology in the field of video image quality enhancement

广汽本田安全体验营:“危险”是最好的老师

Basic configuration of OSPFv3

Architect 04 - Application Service Encryption Design and Practice
随机推荐
程序员如何学习开源项目,这篇文章告诉你
Realization of character makeup
What's wrong with the sql syntax in my sql
高效并发:Synchornized的锁优化详解
Implementing a Simple Framework for Managing Object Information Using Reflection
全网一触即发,自媒体人的内容分发全能助手——融媒宝
Carbon教程之 基本语法入门大全 (教程)
-xms -xmx(information value)
C language parsing json string (json object is converted to string)
手把手教你学会部署Nestjs项目
Qualcomm cDSP simple programming example (to query Qualcomm cDSP usage, signature), RK3588 npu usage query
Implementation of a sequence table
老牌音乐播放器 WinAmp 发布 5.9 RC1 版:迁移到 VS 2019 完全重建,兼容 Win11
Douyin fetches video list based on keywords API
ResNet的基础:残差块的原理
Introduction to Audio Types and Encoding Formats in Unity
A few permanent free network transmission, convenient and simple (Intranet through tutorials)
"The core concept of" image classification and target detection in the positive and negative samples and understanding architecture
Taobao/Tmall get Taobao password real url API
MySQL - single function