1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-27 23:18:42 +02:00

add any to float

This commit is contained in:
Xargin
2017-07-04 19:59:34 +08:00
parent 4ea96ac7c3
commit f245011c7d
3 changed files with 87 additions and 5 deletions

View File

@ -25,12 +25,14 @@ var intConvertMap = map[string]int{
`"false"`: 0,
`"true123"`: 0,
`"123true"`: 123,
`"-123true"`: -123,
`"1.2332e6"`: 1,
`""`: 0,
"+": 0,
"-": 0,
"[]": 0,
"[1,2]": 1,
`["1","2"]`: 1,
// object in php cannot convert to int
"{}": 0,
}
@ -73,6 +75,7 @@ var uintConvertMap = map[string]int{
`"true"`: 0,
`"false"`: 0,
`"true123"`: 0,
`"+1"`: 1,
`"123true"`: 123,
`"-123true"`: 0,
`"1.2332e6"`: 1,