goland 解决 cannot resolve directory 'xxxx'问题
2022/9/14 23:17:11
本文主要是介绍goland 解决 cannot resolve directory 'xxxx'问题,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
发现问题
今天好好的项目突然就好多依赖标红了,go.mod 也全是红的,但是执行 go mod tidy
和 sh build.sh
都没有问题,但是看到标红就浑身难受,自己捣鼓了一通,发现没啥用,最后发现了 cannot resolve directory 'gocarina'
这个报错,抱着死马当活马医的心态上某度搜了一下,发现了不少解决方案。
图源:解决cannot resolve directory问题
原因
原因是Goland 编辑器中项目设置为 go modules 项目,导致从gomod读取,从而飘红
解决方案
点击 Goland -> Perferences -> Go -> Go modules,勾选上 Enable Go modules integration
,依次点击 「Apply」和 「OK」,马上就恢复正常了。
参考:解决cannot resolve directory问题
这篇关于goland 解决 cannot resolve directory 'xxxx'问题的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-04-01got an unexpected keyword argument
- 2024-03-30维多利亚的秘密 golang入坑系统
- 2024-03-29mongodb sort by date
- 2024-03-29go swagger
- 2024-03-25mongodb cdc
- 2024-03-25how to use go in vscode
- 2024-03-22mongooseserverselectionerror: connect econnrefused ::1:27017
- 2024-03-21pymongo insert_many
- 2024-03-18projection mongodb
- 2024-03-14clickhouse-go