转到模块:校验和不匹配 [英] Go modules: checksum mismatch

查看:57
本文介绍了转到模块:校验和不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始在Go中使用模块,但是我经常遇到这样的问题:在一台机器上一切正常,但是在另一台机器上构建代码库时却遇到校验和不匹配的情况.

I recently started using modules in Go, but I frequently encounter issues where everything works fine on one machine, but a checksum mismatch is encountered when building the codebase on another machine.

该问题始终涉及相同的第三方依赖关系(github.com/ericlagergren/decimal):

The issue always concerns the same third party dependency (github.com/ericlagergren/decimal):

go: verifying github.com/ericlagergren/decimal@v0.0.0-20181231230500-73749d4874d5: checksum mismatch
    downloaded: h1:HQGCJNlqt1dUs/BhtEKmqWd6LWS+DWYVxi9+Jo4r0jE=
    go.sum:     h1:x4oNpFLLl+8l+iLgksNHzZewTS0SKp6m0hlLwzXRbqA=

我尝试了多种方法:删除&重新生成 go.sum ,将Go自身升级到最新的补丁程序版本,并从 go.mod 中删除依赖项,但似乎没有任何解决办法.

I've tried various things: removing & regenerating go.sum, upgrading Go itself to the latest patch version and removing the dependency from go.mod but nothing seems to fix this issue.

有人知道如何解决此问题吗?

Does anyone have an idea how to fix this issue?

推荐答案

您正在使用哪个版本的Go?您很有可能遇到 1.11.2->的后果.1.11.4 :

Which version of Go are you using? There's a good chance you're running into the aftermath of the 1.11.2 -> 1.11.4:

还有哪些尚未完全解决.请记住, go mod 仍在开发中,因此类似的事情可能会一直发生到1.13.

Which still isn't completely resolved. Remember that go mod is still in development, so things like this will probably happen up and until 1.13.

请务必阅读Go的次要版本,以及这些事情如何发生: https://github.com/golang/go/wiki/MinorReleases

Be sure to read up on minor releases for Go, and how these things can happen: https://github.com/golang/go/wiki/MinorReleases

TL; DR-升级Go

TL;DR - Upgrade Go

这篇关于转到模块:校验和不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆