goland 解决 cannot resolve directory 'xxxx'/ cannot resolve xxx 问题

简介: goland 解决 cannot resolve directory 'xxxx'/ cannot resolve xxx 问题

发现问题

今天好好的项目突然就好多依赖标红了,go.mod 也全是红的,但是执行 go mod tidysh build.sh 都没有问题,但是看到标红就浑身难受,自己捣鼓了一通,发现没啥用,最后发现了 cannot resolve directory 'gocarina' 这个报错,抱着死马当活马医的心态上某度搜了一下,发现了不少解决方案。

1456655-20220914223239732-996230627.jpg

1456655-20220914223635816-1435900155.png

原因

原因是Goland 编辑器中项目设置为 go modules 项目,导致从gomod读取,从而飘红

解决方案

点击 Goland -> Perferences -> Go -> Go modules,勾选上 Enable Go modules integration,依次点击 「Apply」和 「OK」,马上就恢复正常了。

1456655-20220914222355438-270944633.png

参考:解决cannot resolve directory问题

相关文章
|
2天前
|
iOS开发 MacOS Windows
解决报错 unable to access jarfile apachejmeter.jar 的一些技巧!🔥
解决报错 unable to access jarfile apachejmeter.jar 的一些技巧!🔥
375 6
|
11月前
CMake Error: The source “xxx“ does not match the source “yyy“ used to generate cache. Re-run cmake
CMake Error: The source “xxx“ does not match the source “yyy“ used to generate cache. Re-run cmake
460 0
|
10月前
|
Java Maven
解决Maven中CANNOT Resolve XXX错误
解决Maven中CANNOT Resolve XXX错误
260 0
|
6月前
|
Linux
svn踩坑-xxx is not valid as filename in directory
svn踩坑-xxx is not valid as filename in directory
28 0
|
10月前
|
网络协议
出现“Could not resolve host: www.github.com; Unknown error”错误解决
出现“Could not resolve host: www.github.com; Unknown error”错误解决
393 0
|
开发工具 git
fatal: unable to access ‘https://github.com/.../.git‘: Could not resolve host: github.com解决方法【亲测有效】
1.问题原因 今天在使用Github的时候突然出现了这样的报错,云里雾里,看了网上的解决办法,说是代理服务器的问题,尝试了无数遍无果 然后Ping了一下github网站,发现Ping不通:
1332 0
|
12月前
|
缓存 JavaScript Nacos
Vue 报错整理:npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\jinchuang\AppData...
我是在npm install的时候出现的这个问题,开始是安装不上,提示升级npm,然后我按要求升级npm i npm 依然报错 解决方法:1. 删除本地node_modules 依赖包2. 执行 npm cache clean --force 清理缓存3. npm install。
185 0
|
开发工具 git
完美解决 fatal: unable to access ‘https://github.com/.../.git‘: Could not resolve host: github.com
完美解决 fatal: unable to access ‘https://github.com/.../.git‘: Could not resolve host: github.com
12635 0
Unable to resolve dependency for xxx, Could not resolve project
我们为了在不同的环境使用不同的配置,所以会在gradle中添加buildtypes来区分环境,并且在下面进行不同的配置
168 0
|
Perl
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `cocoapods`. Y...
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `cocoapods`. Y...
1033 0