MCPcopy
hub / github.com/gofiber/fiber / IsNil

Function IsNil

internal/nilerror/nilerror.go:8–20  ·  view source on GitHub ↗

IsNil reports whether err is nil or contains a typed-nil value.

(err error)

Source from the content-addressed store, hash-verified

6
7// IsNil reports whether err is nil or contains a typed-nil value.
8func IsNil(err error) bool {
9 if err == nil {
10 return true
11 }
12
13 v := reflect.ValueOf(err)
14 switch v.Kind() {
15 case reflect.Chan, reflect.Func, reflect.Map, reflect.Pointer, reflect.Slice:
16 return v.IsNil()
17 default:
18 return false
19 }
20}

Callers 3

returnErrMethod · 0.92
DefaultErrorHandlerFunction · 0.92
getEffectiveStatusCodeFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected