go build_error ai_generated true

missing go.sum entry for module providing package github.com/foo/bar; to add: go mod download github.com/foo/bar

ID: go/go-sum-missing-entry

Also available as: JSON · Markdown · 中文
80%Fix Rate
88%Confidence
0Evidence
2024-02-25First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
1.16 active
1.23 active

Root Cause

A dependency was added to go.mod but go.sum was not updated, often due to using -mod=mod without tidy.

generic

中文

依赖已添加到 go.mod 但 go.sum 未更新,通常因为使用 -mod=mod 而未运行 tidy。

Workarounds

  1. 95% success
    go mod tidy
  2. 90% success
    go mod download github.com/foo/bar

Dead Ends

Common approaches that don't work:

  1. 40% fail

    This will regenerate all entries but may take time and cause network issues.

  2. 100% fail

    The hash must match exactly; a random hash will cause checksum mismatch.