- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for IsUintKind (0.12 sec)
-
operator/pkg/util/reflect.go
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: return true } return false }
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
function func(v reflect.Kind) bool want []any }{ { desc: "ints", function: IsIntKind, want: allIntTypes, }, { desc: "uints", function: IsUintKind, want: allUintTypes, }, } for _, tt := range tests { var got []any for _, v := range allTypes { if tt.function(reflect.ValueOf(v).Kind()) { got = append(got, v) }
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
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() if int64(v) < min || int64(v) > max { err = fmt.Errorf("value %s:%v falls out side range [%v, %v]", path, v, min, max) } default:
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Thu Aug 10 15:35:03 UTC 2023 - 11K bytes - Viewed (0)