go import 报红 胡思乱想的男人 2022-07-13 1,506 阅读1分钟 问题 Goland 新建了一个项目,执行了 go mod init,也执行了 go mod tidy,所有依赖都下载成功了,go module 中 require 正常,go 文件中 import 正常。并且其它项目引用这些依赖都正常。 原因 Goland 没有勾选 Enable Go modules integration 选项。 解决 preference -> go -> Go Modules -> 勾选 Enable Go modules integration。