# unexpected end of JSON input

- **ID:** `go/json-unexpected-end-of-input`
- **Domain:** go
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The JSON data being decoded is incomplete or truncated, often due to network issues or premature EOF.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.19 | active | — | — |

## Workarounds

1. **** (85% success)
   ```
   dec := json.NewDecoder(strings.NewReader(data))
if err := dec.Decode(&v); err != nil {
    // handle error
}
   ```
2. **** (80% success)
   ```
   Use json.Valid() to check before unmarshaling.
   ```

## Dead Ends

- **** — The issue is not missing newline but incomplete JSON structure. (80% fail)
- **** — Unmarshal requires complete JSON; partial data will still fail. (90% fail)
