| 288 | } |
| 289 | |
| 290 | func (pars Params) getPid(name string) (uint32, error) { |
| 291 | par, err := pars.findParam(name) |
| 292 | if err != nil { |
| 293 | return uint32(0), err |
| 294 | } |
| 295 | if par.Type != params.PID { |
| 296 | return uint32(0), fmt.Errorf("%q parameter is not a PID", name) |
| 297 | } |
| 298 | v, ok := par.Value.(uint32) |
| 299 | if !ok { |
| 300 | return uint32(0), fmt.Errorf("unable to type cast %q parameter to uint32 value from pid", name) |
| 301 | } |
| 302 | return v, nil |
| 303 | } |
| 304 | |
| 305 | // GetTid returns the thread id from the parameter. |
| 306 | func (pars Params) GetTid() (uint32, error) { |