NewMapOpts creates a new MapOpts with the specified map of values and a validator.
(values map[string]string, validator ValidatorFctType)
| 164 | |
| 165 | // NewMapOpts creates a new MapOpts with the specified map of values and a validator. |
| 166 | func NewMapOpts(values map[string]string, validator ValidatorFctType) *MapOpts { |
| 167 | if values == nil { |
| 168 | values = make(map[string]string) |
| 169 | } |
| 170 | return &MapOpts{ |
| 171 | values: values, |
| 172 | validator: validator, |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | // ValidatorFctType defines a validator function that returns a validated string and/or an error. |
| 177 | type ValidatorFctType func(val string) (string, error) |
no outgoing calls
searching dependent graphs…