(in interface{})
| 262 | } |
| 263 | |
| 264 | func InterfaceToInt64(in interface{}) (int64, bool) { |
| 265 | var ok bool |
| 266 | if in, ok = JSONNumberToInt(in); !ok { |
| 267 | return 0, false |
| 268 | } |
| 269 | |
| 270 | switch casted := in.(type) { |
| 271 | case int8: |
| 272 | return int64(casted), true |
| 273 | case int16: |
| 274 | return int64(casted), true |
| 275 | case int32: |
| 276 | return int64(casted), true |
| 277 | case int: |
| 278 | return int64(casted), true |
| 279 | case int64: |
| 280 | return casted, true |
| 281 | } |
| 282 | return 0, false |
| 283 | } |
| 284 | |
| 285 | func InterfaceToInt64Downcast(in interface{}) (int64, bool) { |
| 286 | var ok bool |
no test coverage detected