# go: missing go.sum entry for module providing package X; to add: go mod tidy

- **ID:** `go/go-mod-tidy-missing-go-sum-entry-for-module-providing-package`
- **Domain:** go
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 98%

## Root Cause

The go.sum file is missing checksums for a dependency required by the current module, often after adding a new import or updating go.mod manually.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| go1.20 | active | — | — |
| go1.21 | active | — | — |
| go1.22 | active | — | — |

## Workarounds

1. **Run 'go mod tidy' to regenerate go.sum with all required checksums** (98% success)
   ```
   Run 'go mod tidy' to regenerate go.sum with all required checksums
   ```
2. **If go mod tidy fails, run 'go mod download' first, then 'go mod tidy'** (95% success)
   ```
   If go mod tidy fails, run 'go mod download' first, then 'go mod tidy'
   ```
3. **For vendored projects, run 'go mod vendor' after tidy to sync vendor directory** (93% success)
   ```
   For vendored projects, run 'go mod vendor' after tidy to sync vendor directory
   ```

## Dead Ends

- **Manually edit go.sum to add the missing checksum** — go.sum is machine-generated and manual edits are overwritten or cause checksum mismatches (95% fail)
- **Delete go.sum and go.mod and start over** — Deletes all dependency info; may lose version constraints and cause other errors (80% fail)
- **Set GONOSUMCHECK=* to bypass checksum verification** — Disables security verification and is not portable across builds (50% fail)
