GetBool returns the underlying boolean value from the parameter.
(name string)
| 349 | |
| 350 | // GetBool returns the underlying boolean value from the parameter. |
| 351 | func (pars Params) GetBool(name string) (bool, error) { |
| 352 | par, err := pars.findParam(name) |
| 353 | if err != nil { |
| 354 | return false, err |
| 355 | } |
| 356 | v, ok := par.Value.(bool) |
| 357 | if !ok { |
| 358 | return false, fmt.Errorf("unable to type cast %q parameter to bool value", name) |
| 359 | } |
| 360 | return v, nil |
| 361 | } |
| 362 | |
| 363 | // MustGetBool returns the underlying boolean value from the parameter or |
| 364 | // panics if the parameter can't be retrieved. |
no test coverage detected