MustStrings requires parameter values to exist to bind to slice of string variables. Returns error when value does not exist
(sourceParam string, dest *[]string)
| 296 | |
| 297 | // MustStrings requires parameter values to exist to bind to slice of string variables. Returns error when value does not exist |
| 298 | func (b *ValueBinder) MustStrings(sourceParam string, dest *[]string) *ValueBinder { |
| 299 | if b.failFast && b.errors != nil { |
| 300 | return b |
| 301 | } |
| 302 | |
| 303 | value := b.ValuesFunc(sourceParam) |
| 304 | if value == nil { |
| 305 | b.setError(b.ErrorFunc(sourceParam, []string{}, "required field value is empty", nil)) |
| 306 | return b |
| 307 | } |
| 308 | *dest = value |
| 309 | return b |
| 310 | } |
| 311 | |
| 312 | // BindUnmarshaler binds parameter to destination implementing BindUnmarshaler interface |
| 313 | func (b *ValueBinder) BindUnmarshaler(sourceParam string, dest BindUnmarshaler) *ValueBinder { |