MCPcopy Create free account
hub / github.com/cel-expr/cel-go / getFieldValue

Function getFieldValue

ext/native.go:767–779  ·  view source on GitHub ↗
(refField reflect.Value)

Source from the content-addressed store, hash-verified

765}
766
767func getFieldValue(refField reflect.Value) any {
768 if refField.IsZero() {
769 switch refField.Kind() {
770 case reflect.Struct:
771 if refField.Type() == timestampType {
772 return time.Unix(0, 0)
773 }
774 case reflect.Pointer:
775 return reflect.New(refField.Type().Elem()).Interface()
776 }
777 }
778 return refField.Interface()
779}
780
781func simplePkgAlias(pkgPath string) string {
782 paths := strings.Split(pkgPath, "/")

Callers 2

FindStructFieldTypeMethod · 0.85
adaptFieldValueFunction · 0.85

Calls 3

NewMethod · 0.80
KindMethod · 0.65
TypeMethod · 0.65

Tested by

no test coverage detected