MCPcopy Index your code
hub / github.com/labstack/echo / durationsValue

Method durationsValue

binder.go:1219–1232  ·  view source on GitHub ↗
(sourceParam string, dest *[]time.Duration, valueMustExist bool)

Source from the content-addressed store, hash-verified

1217}
1218
1219func (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
1234func (b *ValueBinder) durations(sourceParam string, values []string, dest *[]time.Duration) *ValueBinder {
1235 tmp := make([]time.Duration, len(values))

Callers 2

DurationsMethod · 0.95
MustDurationsMethod · 0.95

Calls 2

setErrorMethod · 0.95
durationsMethod · 0.95

Tested by

no test coverage detected