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

目录
打赏
0
0
0
0
13
分享
相关文章
|
8月前
解决Flutter报错The named parameter |method ‘xxxx‘ isn‘t defined.
解决Flutter报错The named parameter |method ‘xxxx‘ isn‘t defined.
345 3
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.suppor
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.suppor
出现“Could not resolve host: www.github.com; Unknown error”错误解决
出现“Could not resolve host: www.github.com; Unknown error”错误解决
742 0
error: Two output files share the same path but have different contents: node_modules\.vite\..xxx.js
error: Two output files share the same path but have different contents: node_modules\.vite\..xxx.js
841 0
error: Two output files share the same path but have different contents: node_modules\.vite\..xxx.js
ERROR in ./src/index.js Module not found: Error: Can't resolve 'babel-runtime/helpers/classCallCheck
ERROR in ./src/index.js Module not found: Error: Can't resolve 'babel-runtime/helpers/classCallCheck
551 0
Unable to resolve dependency for ‘xxx项目@debug/compileClasspath‘: Could not resolve com.jakew
Unable to resolve dependency for ‘xxx项目@debug/compileClasspath‘: Could not resolve com.jakew
Unable to resolve dependency for ‘xxx项目@debug/compileClasspath‘: Could not resolve com.jakew
[!] 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...
2178 0
Unable to resolve dependency for xxx, Could not resolve project
我们为了在不同的环境使用不同的配置,所以会在gradle中添加buildtypes来区分环境,并且在下面进行不同的配置
211 0

热门文章

最新文章

AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等