Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for IsIntKind (0.08 sec)

  1. 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)
Back to top