(in interface{})
| 364 | } |
| 365 | |
| 366 | func JSONNumberToInt(in interface{}) (interface{}, bool) { |
| 367 | number, ok := in.(json.Number) |
| 368 | if !ok { |
| 369 | return in, true |
| 370 | } |
| 371 | inInt, err := number.Int64() |
| 372 | if err == nil { |
| 373 | return inInt, true |
| 374 | } |
| 375 | return nil, false |
| 376 | } |
| 377 | |
| 378 | func JSONNumberToIntOrFloat(in interface{}) (interface{}, bool) { |
| 379 | number, ok := in.(json.Number) |
no outgoing calls
no test coverage detected