Documentation ¶
Index ¶
- func ContainsNoneOf(s string, chars string, msg string, args ...any) error
- func False(condition bool, msg string, args ...any) error
- func IsEmpty[T any](s []T, msg string, args ...any) error
- func IsGreaterOrEqual[T math.Number](value, other T, msg string, args ...any) error
- func IsGreaterOrEqualToZero[T math.Number](value T, msg string, args ...any) error
- func IsGreaterThan[T math.Number](value, other T, msg string, args ...any) error
- func IsGreaterThanZero[T math.Number](value T, msg string, args ...any) error
- func IsNotEmpty[T any](s []T, msg string, args ...any) error
- func KeyNotInMap[K comparable, V any](key K, m map[K]V, msg string, args ...any) error
- func NoNullChars(s string, msg string, args ...any) error
- func NoSpaces(s string, msg string, args ...any) error
- func NotBlank(s string, msg string, args ...any) error
- func NotNil(value any, msg string, args ...any) error
- func True(condition bool, msg string, args ...any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsNoneOf ¶ added in v1.5.0
ContainsNoneOf checks if the provided string contains none of the characters in the given set. It returns an error if the string contains any of the specified characters, using the provided message and arguments.
func False ¶ added in v1.5.1
False checks if the provided condition is false. Returns an error if the condition is true, using the provided message and arguments.
func IsEmpty ¶
IsEmpty checks if the provided slice is empty. It returns an error if the slice is not empty, using the provided message and arguments. T is a generic type, allowing the function to work with slices of any type.
func IsGreaterOrEqual ¶ added in v1.3.2
IsGreaterOrEqual checks if the first provided numeric value (of type T) is greater or equal to the second. It returns an error if the first value is less than the second, using the provided message and arguments. T is a generic type constrained to math.Number, allowing the function to work with various numeric types.
func IsGreaterOrEqualToZero ¶ added in v1.3.2
IsGreaterOrEqualToZero checks if the provided numeric value (of type T) is greater or equal to zero. It returns an error if the value is less than zero, using the provided message and arguments. T is a generic type constrained to math.Number, allowing the function to work with various numeric types.
func IsGreaterThan ¶ added in v1.3.2
IsGreaterThan checks if the first provided numeric value (of type T) is greater than the second. It returns an error if the first value is not greater than the second, using the provided message and arguments. T is a generic type constrained to math.Number, allowing the function to work with various numeric types.
func IsGreaterThanZero ¶ added in v1.2.1
IsGreaterThanZero checks if the provided numeric value (of type T) is greater than zero. It returns an error if the value is not greater than zero, using the provided message and arguments. T is a generic type constrained to math.Number, allowing the function to work with various numeric types.
func IsNotEmpty ¶
IsNotEmpty checks if the provided slice is not empty. It returns an error if the slice is empty, using the provided message and arguments. T is a generic type, allowing the function to work with slices of any type.
func KeyNotInMap ¶ added in v1.5.0
func KeyNotInMap[K comparable, V any](key K, m map[K]V, msg string, args ...any) error
KeyNotInMap checks if the given key does not exist in the provided map. It returns an error if the key exists in the map, using the provided message and arguments. K is a generic type for the map key, which must be comparable. V is a generic type for the map value, which can be any type.
func NoNullChars ¶ added in v1.5.0
NoNullChars checks if the provided string contains no null characters (ASCII 0). It returns an error if the string contains any null characters, using the provided message and arguments.
func NoSpaces ¶ added in v1.5.0
NoSpaces checks if the provided string contains no whitespace characters. It returns an error if the string contains any whitespace, using the provided message and arguments.
func NotBlank ¶ added in v1.5.0
NotBlank checks if the provided string is not empty or consisting only of whitespace. It returns an error if the string is blank, using the provided message and arguments.
Types ¶
This section is empty.