GetUint16 returns the underlying int16 value from the parameter.
(name string)
| 395 | |
| 396 | // GetUint16 returns the underlying int16 value from the parameter. |
| 397 | func (pars Params) GetUint16(name string) (uint16, error) { |
| 398 | par, err := pars.findParam(name) |
| 399 | if err != nil { |
| 400 | return uint16(0), err |
| 401 | } |
| 402 | v, ok := par.Value.(uint16) |
| 403 | if !ok { |
| 404 | return uint16(0), fmt.Errorf("unable to type cast %q parameter to uint16 value", name) |
| 405 | } |
| 406 | return v, nil |
| 407 | } |
| 408 | |
| 409 | // MustGetUint16 returns the underlying uint16 value parameter. It panics if |
| 410 | // an error occurs while trying to get the parameter. |
no test coverage detected