# error: json: cannot unmarshal object into Go value of type string

- **ID:** `go/encoding-json-unmarshal-into-interface-with-concrete-type`
- **Domain:** go
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Attempting to unmarshal a JSON object into a Go string variable, which requires a struct or map.

## Version Compatibility

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

## Workarounds

1. **Unmarshal into a map or struct first** (90% success)
   ```
   var result map[string]interface{}
if err := json.Unmarshal(data, &result); err != nil { return err }
strVal, ok := result["key"].(string)
   ```

## Dead Ends

- **Using type assertion after unmarshal into interface** — Still fails if target type is string; use proper struct. (70% fail)
