Documentation
¶
Index ¶
- Variables
- func Between[T Number](value, lowerBound, upperBound T) error
- func Max[T Number](value, upperBound T) error
- func Min[T Number](value, lowerBound T) error
- func MultipleOf[T Integer](value, divisor T) error
- func Negative[T Number](value T) error
- func NonNegative[T Number](value T) error
- func Positive[T Number](value T) error
- type Integer
- type Number
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPositive = errors.New("validate: value must be positive") ErrBetween = errors.New("validate: value must be between") ErrNegative = errors.New("validate: value must be negative") ErrNonNegative = errors.New("validate: value must be non-negative") ErrMax = errors.New("validate: value must be less or equal than") ErrMin = errors.New("validate: value must be greater or equal than") ErrDivisorZero = errors.New("validate: divisor cannot be zero") ErrMultipleOf = errors.New("validate: value must be multiple of") )
Functions ¶
func Between ¶
Between validates if a value is within the specified lower and upper bounds (inclusive).
func MultipleOf ¶
MultipleOf validates if a value is a multiple of the specified divisor.
func NonNegative ¶
NonNegative validates that the provided numeric value is non-negative (including zero).
Types ¶
Click to show internal directories.
Click to hide internal directories.