【记录一个问题】go.mod中使用replace后,编译出现神奇的错误:

biz\child.go:5:2: imported and not used: "xxx.com/start/common/src/polaris" as biz
biz\child.go:17:9: undefined: polaris

前面告诉我导入了未使用,后面又告诉我没导入……你到底要我怎么样……

问题应该是使用了本地路径代替远端仓库上的路径而导致的。
原因还在找。

============================================================
2020-09-15补充:

  • 问题的原因在将要导入的库上
    库的目录名是 polaris, 但是 xx.go中却写了 package other_name
    导致根本无法识别这个库。

posted on 2020-09-14 14:29  ahfuzhang  阅读(495)  评论(0编辑  收藏  举报