- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for IsValueNil (0.1 sec)
-
operator/pkg/util/reflect.go
func IsNilOrInvalidValue(v reflect.Value) bool { return !v.IsValid() || (v.Kind() == reflect.Ptr && v.IsNil()) || IsValueNil(v.Interface()) } // IsValueNil returns true if either value is nil, or has dynamic type {ptr, // map, slice} with value nil. func IsValueNil(value any) bool { if value == nil { return true } switch kindOf(value) { case reflect.Slice, reflect.Ptr, reflect.Map:
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Mon Jul 25 19:30:47 UTC 2022 - 8.6K bytes - Viewed (0) -
operator/pkg/tpath/struct.go
scope.Debugf("getFromStructPath path=%s, node(%T)", path, node) if len(path) == 0 { scope.Debugf("getFromStructPath returning node(%T)%v", node, node) return node, !util.IsValueNil(node), nil } // For protobuf types, switch them out with standard types; otherwise we will traverse protobuf internals rather // than the standard representation if v, ok := node.(*structpb.Struct); ok {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Mon Jul 25 19:30:47 UTC 2022 - 4.4K bytes - Viewed (0) -
operator/pkg/validate/validate.go
} func validateLeaf(validations map[string]ValidatorFunc, path util.Path, val any, checkRequired bool) util.Errors { pstr := path.String() msg := fmt.Sprintf("validate %s:%v(%T) ", pstr, val, val) if util.IsValueNil(val) || util.IsEmptyString(val) { if checkRequired && requiredValues[pstr] { return util.NewErrs(fmt.Errorf("field %s is required but not set", util.ToYAMLPathString(pstr))) }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Thu Jan 12 16:04:15 UTC 2023 - 7.7K bytes - Viewed (0)