go
data_error
ai_generated
true
json: cannot unmarshal number 1e+1000 into Go value of type int
ID: go/json-number-overflow
80%Fix Rate
86%Confidence
0Evidence
2024-11-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.12 | active | — | — | — |
Root Cause
JSON中的数字超出目标Go类型的范围
generic中文
JSON中的数字超出目标Go类型的范围
Workarounds
-
90% success
使用json.Number类型
-
85% success
自定义UnmarshalJSON方法
Dead Ends
Common approaches that don't work:
-
60% fail
精度丢失
-
70% fail
仍然溢出