go mod module declares its path as: gtihub.com/xxx-xx but was required as:xx-xx

go mod的坑

使用go-mod 引入某个包出错例子为

go: github.com/beego/bee imports
        github.com/beego/bee/cmd imports
        github.com/beego/bee/cmd/commands/dlv imports
        github.com/derekparker/delve/service: github.com/derekparker/[email protected]: parsing go.mod:
        module declares its path as: github.com/go-delve/delve
                but was required as: github.com/derekparker/delve

module declares its path as: github.com/go-delve/delve
but was required as: github.com/derekparker/delve

这句话的意思是

模块将其路径声明为:
但被要求:

module declares its path as:
but was required as:
解决办法

在你当前的项目下的

go.mod

文件中
加入

replace github.com/go-delve/delve => github.com/derekparker/delve v1.3.2 // indirect

格式为:

replace module declares its path as:(后边那部分) => but was required as:(后边那部分)

你可能感兴趣的:(go)