英文:
Can Go module Checksum verification be bypassed?
问题
我正在使用用Go编写的Cosmos SDK进行实验。该SDK在一个不同的模块中使用(通过go.mod
中的require
指令)。
我将称这个模块为模块x。如果对SDK(位于$GOPATH/pkg/mod/github.com/cosmos/cosmos-sdk@v0.44.5
)进行任何更改,编译模块x会失败,因为校验和不匹配(它会抱怨cosmos-sdk目录已被修改)。
我已经查找了一些方法来正确管理这个问题,但如何绕过这个验证步骤呢?
英文:
I am experimenting with the Cosmos SDK written in Go. The SDK is used in a different module (via require
directive in go.mod
).
I will call this module x. If any changes are made to the SDK (in $GOPATH/pkg/mod/github.com/cosmos/cosmos-sdk@v0.44.5
), compilation of module x fails due to a checksum mismatch (it complains that the cosmos-sdk directory has been modified).
I have looked around and there are proper ways of managing this, but how can this verification step be bypassed?
答案1
得分: 3
你想在你的 go.mod
文件中使用 replace 指令,并将其指向本地修改的源代码路径。
英文:
You want to use the replace directive in your go.mod
and point it at the locally modified source code path.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论