MCPcopy
hub / github.com/ory/kratos / IsNil

Function IsNil

pkg/httpclient/utils.go:335–346  ·  view source on GitHub ↗

IsNil checks if an input is nil

(i interface{})

Source from the content-addressed store, hash-verified

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

Callers 15

GetConfigMethod · 0.70
GetConfigOkMethod · 0.70
HasConfigMethod · 0.70
ToMapMethod · 0.70
GetExpiresInMethod · 0.70
GetExpiresInOkMethod · 0.70
HasExpiresInMethod · 0.70
GetFlowTypeMethod · 0.70
GetFlowTypeOkMethod · 0.70
HasFlowTypeMethod · 0.70
ToMapMethod · 0.70
GetCsrfTokenMethod · 0.70

Calls 1

IsZeroMethod · 0.45

Tested by

no test coverage detected