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

Method Set

pkg/event/param.go:208–215  ·  view source on GitHub ↗

Set replaces the value that is indexed at existing parameter name. It will return an error if the supplied parameter is not present.

(name string, value params.Value, typ params.Type)

Source from the content-addressed store, hash-verified

206// Set replaces the value that is indexed at existing parameter name. It will return an error
207// if the supplied parameter is not present.
208func (pars Params) Set(name string, value params.Value, typ params.Type) error {
209 _, err := pars.findParam(name)
210 if err != nil {
211 return fmt.Errorf("setting the value on a missing %q parameter is not allowed", name)
212 }
213 pars[name] = &Param{Name: name, Value: value, Type: typ}
214 return nil
215}
216
217// SetValue replaces the value for the given parameter name. It will return an error
218// if the supplied parameter is not present in the parameter map.

Callers 1

TestParamsFunction · 0.95

Calls 1

findParamMethod · 0.95

Tested by 1

TestParamsFunction · 0.76