Duration binds a form field to a time.Duration variable. It populates an error if the form field is not time.Duration. var foo time.Duration ctx.FormData().Duration("foo", &foo, time.Duration(2) * time.Second)
(key string, target *time.Duration, defaultValue time.Duration)
| 150 | // |
| 151 | // ctx.FormData().Duration("foo", &foo, time.Duration(2) * time.Second) |
| 152 | func (form *FormData) Duration(key string, target *time.Duration, defaultValue time.Duration) *FormData { |
| 153 | return form.mustValue(key, target, defaultValue) |
| 154 | } |
| 155 | |
| 156 | // MandatoryDuration binds a form field to a time.Duration variable. It |
| 157 | // populates an error if the value is not time.Duration, or is empty, or the |