GetStringSlice returns the string slice from the event parameter.
(name string)
| 656 | |
| 657 | // GetStringSlice returns the string slice from the event parameter. |
| 658 | func (pars Params) GetStringSlice(name string) ([]string, error) { |
| 659 | par, err := pars.GetSlice(name) |
| 660 | if err != nil { |
| 661 | return nil, err |
| 662 | } |
| 663 | v, ok := par.([]string) |
| 664 | if !ok { |
| 665 | return nil, fmt.Errorf("unable to type cast %q parameter to string slice", name) |
| 666 | } |
| 667 | return v, nil |
| 668 | } |
| 669 | |
| 670 | // GetSlice returns the slice of generic values from the parameter. |
| 671 | func (pars Params) GetSlice(name string) (params.Value, error) { |
no test coverage detected