IsNil checks if an input is nil
(i interface{})
| 330 | |
| 331 | // IsNil checks if an input is nil |
| 332 | func IsNil(i interface{}) bool { |
| 333 | if i == nil { |
| 334 | return true |
| 335 | } |
| 336 | switch reflect.TypeOf(i).Kind() { |
| 337 | case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: |
| 338 | return reflect.ValueOf(i).IsNil() |
| 339 | case reflect.Array: |
| 340 | return reflect.ValueOf(i).IsZero() |
| 341 | } |
| 342 | return false |
| 343 | } |
| 344 | |
| 345 | type MappedNullable interface { |
| 346 | ToMap() (map[string]interface{}, error) |
no outgoing calls
no test coverage detected