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问题

相关文章
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
1007 0
|
6月前
|
JavaScript
F12控制台打印报Syntax Error: D:\project\xxxx\xxxx\若依系统\RuoYi-Vue-master\ruoyi-ui\src\views,console打印没加““
F12控制台打印报Syntax Error: D:\project\xxxx\xxxx\若依系统\RuoYi-Vue-master\ruoyi-ui\src\views,console打印没加““
|
Java Maven
解决Maven中CANNOT Resolve XXX错误
解决Maven中CANNOT Resolve XXX错误
621 0
Error:npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\XX\package.json‘son‘
Error:npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\XX\package.json‘son‘
|
小程序
npm ERR! enoent ENOENT: no such file or directory, open ‘D:\package.json‘
npm ERR! enoent ENOENT: no such file or directory, open ‘D:\package.json‘
137 0
|
Linux
svn踩坑-xxx is not valid as filename in directory
svn踩坑-xxx is not valid as filename in directory
120 0
|
网络协议
出现“Could not resolve host: www.github.com; Unknown error”错误解决
出现“Could not resolve host: www.github.com; Unknown error”错误解决
639 0
|
应用服务中间件 nginx 网络协议
sed: 1: “s/os.remove(“/xx/xxx. ...“: invalid command code f
sed: 1: “s/os.remove(“/xx/xxx. ...“: invalid command code f
|
SQL Java 数据库连接
Could not find resource xxx/xxxx/xxx.xml报错解决
Could not find resource xxx/xxxx/xxx.xml报错解决
Could not find resource xxx/xxxx/xxx.xml报错解决