- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for IsMapPtr (0.13 sec)
-
operator/pkg/util/reflect.go
return kindOf(value) == reflect.Ptr } // IsMap reports whether value is a map type. func IsMap(value any) bool { return kindOf(value) == reflect.Map } // IsMapPtr reports whether v is a map ptr type. func IsMapPtr(v any) bool { t := reflect.TypeOf(v) return t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Map } // IsSlice reports whether value is a slice type. func IsSlice(value any) bool {
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
// Set sets out with the value at path from node. out is not set if the path doesn't exist or the value is nil. func Set(val, out any) error { // Special case: map out type must be set through map ptr. if util.IsMap(val) && util.IsMapPtr(out) { reflect.ValueOf(out).Elem().Set(reflect.ValueOf(val)) return nil } if util.IsSlice(val) && util.IsSlicePtr(out) { reflect.ValueOf(out).Elem().Set(reflect.ValueOf(val)) return nil }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Mon Jul 25 19:30:47 UTC 2022 - 4.4K bytes - Viewed (0)