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

Method durations

binder.go:1234–1251  ·  view source on GitHub ↗
(sourceParam string, values []string, dest *[]time.Duration)

Source from the content-addressed store, hash-verified

1232}
1233
1234func (b *ValueBinder) durations(sourceParam string, values []string, dest *[]time.Duration) *ValueBinder {
1235 tmp := make([]time.Duration, len(values))
1236 for i, v := range values {
1237 t, err := time.ParseDuration(v)
1238 if err != nil {
1239 b.setError(b.ErrorFunc(sourceParam, []string{v}, "failed to bind field value to Duration", err))
1240 if b.failFast {
1241 return b
1242 }
1243 continue
1244 }
1245 tmp[i] = t
1246 }
1247 if b.errors == nil {
1248 *dest = tmp
1249 }
1250 return b
1251}
1252
1253// UnixTime binds parameter to time.Time variable (in local Time corresponding to the given Unix time).
1254//

Callers 2

bindWithDelimiterMethod · 0.95
durationsValueMethod · 0.95

Calls 1

setErrorMethod · 0.95

Tested by

no test coverage detected