method
TextListField.Required
Require a nonempty list.
Example
field.TextList("tags").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 TextListField; the original field is unchanged.
TextListFieldHow it works
Missing, null, and [] fail when required. A positive MinRows also requires items, even with Required(false).
Use MinLength(1) as well to reject empty strings inside the list.
Full signature
func (f TextListField) Required(values ...bool) TextListFieldRelated types
TextListFieldA configurable list of strings.