常見問題之Golang——verifying github.com/go-playground/assert/v2@v2.0.1/go.mod: checksum mismatch錯誤
背景
本系列文章均為學習過程中記錄的筆記,歡迎和我一起來學習Go語言铸本。
全文使用環(huán)境如下:
- 操作系統(tǒng):windows10
- 使用工具:Goland開發(fā)工具
- golang版本:1.17
簡介
本文主要是對我日常在使用golang時遇到的一些問題與解決方式進行的匯總肮雨,在此提供給大家便于排查一些遇到的問題,其中有更好的解決方案可在評論區(qū)留言箱玷。
正文
錯誤
verifying github.com/go-playground/assert/v2@v2.0.1/go.mod: checksum mismatch
downloaded: h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
go.sum: h1:VDjEfimB/XKnb+ZQfWdccd7VUvSsrcVu0Titje2rxJ4=
SECURITY ERROR
This download does NOT match an earlier download recorded in go.sum.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.
For more information, see 'go help module-auth'.
造成原因分析:
更換golang版本后出現(xiàn)上述問題怨规,版本更換后陌宿,加載原有緩存出現(xiàn)問題,需要重新拉取椅亚。
解決方案:
重新生成使用的go.sum
go clean -modcache
rm go.sum
go mod tidy
本文聲明:
88x31.png
知識共享許可協(xié)議
本作品由 cn華少 采用 知識共享署名-非商業(yè)性使用 4.0 國際許可協(xié)議 進行許可限番。