go语言编程常见问题

编程随笔 / 2023-08-15 / 原文

在Goland中运行单元测试报错Error: Cannot find package

如下图,在Goland中运行单元测试时报错:“Error: Cannot find package”

弹出如下报错提示窗口:

解决办法:在Goland设置界面中取消勾选“Enable Go modules integration”。

参考:goland中运行go 时报package xxx is not in GOROOT