# go: parsing go.mod: unexpected end of JSON input

- **ID:** `go/invalid-go-mod-file`
- **Domain:** go
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The go.mod file is malformed, possibly due to corruption or incorrect manual editing.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.20 | active | — | — |
| 1.21 | active | — | — |
| 1.22 | active | — | — |

## Workarounds

1. **Restore go.mod from version control or a backup.** (90% success)
   ```
   Use 'git checkout go.mod' or copy from a known good state.
   ```
2. **Recreate go.mod by running 'go mod init' and re-adding dependencies.** (80% success)
   ```
   Backup current go.mod, delete it, run 'go mod init <module>', then 'go get' each dependency.
   ```

## Dead Ends

- **Running 'go mod tidy' to fix the file.** — Go cannot parse the file to begin with; tidy requires valid syntax. (100% fail)
- **Adding random text to the end of go.mod to complete JSON.** — Go.mod is not JSON; it's a custom format. Adding JSON will cause more errors. (100% fail)
