FormValueOr returns the form field value or default value for the provided name. Note: FormValueOr does not distinguish if form had no value by that name or value was empty string
(name, defaultValue string)
| 401 | // FormValueOr returns the form field value or default value for the provided name. |
| 402 | // Note: FormValueOr does not distinguish if form had no value by that name or value was empty string |
| 403 | func (c *Context) FormValueOr(name, defaultValue string) string { |
| 404 | value := c.FormValue(name) |
| 405 | if value == "" { |
| 406 | value = defaultValue |
| 407 | } |
| 408 | return value |
| 409 | } |
| 410 | |
| 411 | // FormValues returns the form field values as `url.Values`. |
| 412 | func (c *Context) FormValues() (url.Values, error) { |