- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for IsIntKind (0.19 sec)
-
operator/pkg/util/reflect.go
if IsValueNil(val) { return 0, false } v := reflect.ValueOf(val) switch { case IsIntKind(v.Kind()): return int(v.Int()), true case IsUintKind(v.Kind()): return int(v.Uint()), true } return 0, false } // IsIntKind reports whether k is an integer kind of any size. func IsIntKind(k reflect.Kind) bool { switch k { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
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/util/reflect_test.go
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Mon Jul 25 19:30:47 UTC 2022 - 10.2K bytes - Viewed (0) -
operator/pkg/validate/common.go
// validateIntRange checks whether val is an integer in [min, max]. func validateIntRange(path util.Path, val any, min, max int64) util.Errors { k := reflect.TypeOf(val).Kind() var err error switch { case util.IsIntKind(k): v := reflect.ValueOf(val).Int() if v < min || v > max { err = fmt.Errorf("value %s:%v falls outside range [%v, %v]", path, v, min, max) } case util.IsUintKind(k): v := reflect.ValueOf(val).Uint()
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Thu Aug 10 15:35:03 UTC 2023 - 11K bytes - Viewed (0)