MCPcopy Create free account
hub / github.com/bytebase/bytebase / IsNil

Function IsNil

backend/common/util.go:228–244  ·  view source on GitHub ↗
(val any)

Source from the content-addressed store, hash-verified

226}
227
228func IsNil(val any) bool {
229 if val == nil {
230 return true
231 }
232
233 v := reflect.ValueOf(val)
234 k := v.Kind()
235 switch k {
236 case reflect.Chan, reflect.Func, reflect.Map, reflect.Pointer,
237 reflect.UnsafePointer, reflect.Interface, reflect.Slice:
238 return v.IsNil()
239 default:
240 // Other types cannot be nil
241 }
242
243 return false
244}
245
246// Uniq returns a new slice with duplicate elements removed, preserving order.
247func Uniq[T comparable](array []T) []T {

Callers 2

dmlNodeLocFunction · 0.92
WrapUnaryMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected