MCPcopy Create free account
hub / github.com/upper/db / toInterfaceArray

Function toInterfaceArray

comparison.go:165–179  ·  view source on GitHub ↗
(value interface{})

Source from the content-addressed store, hash-verified

163}
164
165func toInterfaceArray(value interface{}) []interface{} {
166 rv := reflect.ValueOf(value)
167 switch rv.Type().Kind() {
168 case reflect.Ptr:
169 return toInterfaceArray(rv.Elem().Interface())
170 case reflect.Slice:
171 elems := rv.Len()
172 args := make([]interface{}, elems)
173 for i := 0; i < elems; i++ {
174 args[i] = rv.Index(i).Interface()
175 }
176 return args
177 }
178 return []interface{}{value}
179}

Callers 4

InFunction · 0.85
AnyOfFunction · 0.85
NotInFunction · 0.85
NotAnyOfFunction · 0.85

Calls 2

KindMethod · 0.80
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…