Length adds an error if the slice length is not in the given range.
(min, max int)
| 23 | |
| 24 | // Length adds an error if the slice length is not in the given range. |
| 25 | func (e *SliceError[T, V]) Length(min, max int) *SliceError[T, V] { |
| 26 | e.Func(SliceLength[T, V](min, max)) |
| 27 | return e |
| 28 | } |
| 29 | |
| 30 | // NotEmptySlice accepts any slice and returns a message if the value is empty. |
| 31 | func NotEmptySlice[T any, V SliceType[T]](s V) string { |