(sourceParam string, dest *[]time.Duration, valueMustExist bool)
| 1217 | } |
| 1218 | |
| 1219 | func (b *ValueBinder) durationsValue(sourceParam string, dest *[]time.Duration, valueMustExist bool) *ValueBinder { |
| 1220 | if b.failFast && b.errors != nil { |
| 1221 | return b |
| 1222 | } |
| 1223 | |
| 1224 | values := b.ValuesFunc(sourceParam) |
| 1225 | if len(values) == 0 { |
| 1226 | if valueMustExist { |
| 1227 | b.setError(b.ErrorFunc(sourceParam, []string{}, "required field value is empty", nil)) |
| 1228 | } |
| 1229 | return b |
| 1230 | } |
| 1231 | return b.durations(sourceParam, values, dest) |
| 1232 | } |
| 1233 | |
| 1234 | func (b *ValueBinder) durations(sourceParam string, values []string, dest *[]time.Duration) *ValueBinder { |
| 1235 | tmp := make([]time.Duration, len(values)) |
no test coverage detected