今天,进行fork已经存在的go package 来进行开发时,发现不能导入修改过的包会出现如下问题:
go: github.com/ECacheFS/memberlist: github.com/ECacheFS/memberlist@v0.2.2: parsing go.mod: module declares its path as: github.com/hashicorp/memberlist but was required as: github.com/ECacheFS/memberlist
我的仓库是:
https://github.com/ECacheFS/memberlist
解决这个问题,很简单,直接重新为fork的仓库打tag就行:
git tag v0.2.3 git push --tags
并且修改go.mod 中对应的导出包;
参考链接:https://github.com/golang/lint/issues/474#issuecomment-674525970
保持更新;