MCPcopy Create free account
hub / github.com/araddon/qlbridge / findValue

Function findValue

datasource/context_wrapper.go:51–61  ·  view source on GitHub ↗

unwind pointers, etc to find either the value or flag indicating was nil

(v reflect.Value)

Source from the content-addressed store, hash-verified

49
50// unwind pointers, etc to find either the value or flag indicating was nil
51func findValue(v reflect.Value) (reflect.Value, bool) {
52 for ; v.Kind() == reflect.Ptr || v.Kind() == reflect.Interface; v = v.Elem() {
53 if v.IsNil() {
54 return v, true
55 }
56 if v.Kind() == reflect.Interface && v.NumMethod() > 0 {
57 break
58 }
59 }
60 return v, false
61}
62
63var zero reflect.Value
64

Callers 1

evalFieldMethod · 0.85

Calls 1

KindMethod · 0.65

Tested by

no test coverage detected