MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / GetSlice

Method GetSlice

pkg/event/param.go:671–680  ·  view source on GitHub ↗

GetSlice returns the slice of generic values from the parameter.

(name string)

Source from the content-addressed store, hash-verified

669
670// GetSlice returns the slice of generic values from the parameter.
671func (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.

Callers 1

GetStringSliceMethod · 0.95

Calls 1

findParamMethod · 0.95

Tested by

no test coverage detected