method
NumberListField.Required
Require a nonempty list.
Example
field.NumberList("availableSizes").Required()Arguments
| Argument | Type | Description |
|---|---|---|
values | []bool | Omit the argument or pass true to require at least one item; pass false to make the field optional. |
Returns
The updated NumberListField; the original field is unchanged.
NumberListFieldHow it works
Missing, null, and [] fail when required. A positive MinRows also requires items, even with Required(false).
Full signature
func (f NumberListField) Required(values ...bool) NumberListFieldRelated types
NumberListFieldA configurable list of numbers.