在Goland IDE中导入本地Go模块出错

内部导入(使用)Go模块的正确方法是什么?

举个例子:

通过以下方式创建一个新模块:Go mod init example.com/my-project(example.com或其他不存在的域),并在同一个项目中使用它:

import (
    "example.com/my-project/package"
)

这个样本取自Let's Go这本书(已简化)。

问题:

我用的Goland它不承认这个本地模块,Goland建议我使用Go-t example.com/my-project/Package命令,但是example.com/...只是一个模块的名称。

enter image description here

As @JimB mentioned, the problem related to Goland IDE. I found solution here.

Enabling Go modules (vgo) integration solves my problem.

enter image description here