MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / isNil

Function isNil

pkg/cachep/bloom/cachebloom.go:146–158  ·  view source on GitHub ↗

isNil 使用反射检查值是否为 nil

(value interface{})

Source from the content-addressed store, hash-verified

144
145// isNil 使用反射检查值是否为 nil
146func isNil(value interface{}) bool {
147 if value == nil {
148 return true
149 }
150
151 v := reflect.ValueOf(value)
152 switch v.Kind() {
153 case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.Interface, reflect.Slice:
154 return v.IsNil()
155 default:
156 return reflect.DeepEqual(value, reflect.Zero(v.Type()).Interface())
157 }
158}

Callers 1

QueryDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected