function

NumberList

Add a field containing an ordered list of numbers.

Example

go
field.NumberList("availableSizes").Min(0).MaxRows(20)

Arguments

ArgumentTypeDescription
namestringThe stored field name.

Returns

A NumberListField definition. Call its methods to set item limits, list length, defaults, or callbacks.

NumberListField

How it works

Order and duplicates are preserved. Items must be finite numbers; numeric strings are rejected. Min and Max apply to each number, including both bounds.

Required requires at least one item. MinRows and MaxRows count items; they do not limit each item’s value. An explicit empty list remains an empty array.

Validators and hooks receive the complete []float64 value. Use Array for items with child fields, or MultiSelect for choices from a predefined set.

Full signature

Related types

Related guides