发现 gomodule 项目中,执行 go mod tidy 会发生这样的错误,
github.com/xormplus/xorm tested by
github.com/xormplus/xorm.test imports
github.com/go-xorm/core: github.com/go-xorm/[email protected]: parsing go.mod:
module declares its path as: xorm.io/core
but was required as: github.com/go-xorm/core
于是找到两种方式去解决:
1.全部删除,再执行 go mod tidy 重新生成
2.添加 replace github.com/go-xorm/core v0.6.3 => xorm.io/core v0.6.3
但是执行后,go.mod 版本发生了变化,无法做到和之前版本一致,这个问题大家是如何解决的呢?还是这种用法就是错误的,go mod tidy 只能在项目初期使用?
1
reus 2020-07-08 15:29:49 +08:00 via Android
|