# error: json: unsupported type: chan int

- **ID:** `go/json-marshal-unsupported-type`
- **Domain:** go
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

尝试将 Go 中不支持 JSON 序列化的类型（如 channel、complex、func）传递给 json.Marshal。

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   func (c MyChan) MarshalJSON() ([]byte, error) { return json.Marshal(c.String()) }
   ```
2. **** (85% success)
   ```
   type MyStruct struct { Data []int `json:"data"` }
   ```

## Dead Ends

- **** — 会丢失类型信息，且无法还原为原始数据。 (80% fail)
- **** — 如果该字段是必须的，忽略会导致数据不完整。 (60% fail)
