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)
| 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. |
| 208 | func (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. |