GetSlice returns the slice of generic values from the parameter.
(name string)
| 669 | |
| 670 | // GetSlice returns the slice of generic values from the parameter. |
| 671 | func (pars Params) GetSlice(name string) (params.Value, error) { |
| 672 | par, err := pars.findParam(name) |
| 673 | if err != nil { |
| 674 | return nil, err |
| 675 | } |
| 676 | if reflect.TypeOf(par.Value).Kind() != reflect.Slice { |
| 677 | return nil, fmt.Errorf("%q parameter is not a slice", name) |
| 678 | } |
| 679 | return par.Value, nil |
| 680 | } |
| 681 | |
| 682 | // MustGetSlice returns the slice of generic values from the parameter or |
| 683 | // panics if the parameter cannot be found. |
no test coverage detected