GetTid returns the thread id from the parameter.
()
| 304 | |
| 305 | // GetTid returns the thread id from the parameter. |
| 306 | func (pars Params) GetTid() (uint32, error) { |
| 307 | par, err := pars.findParam(params.ThreadID) |
| 308 | if err != nil { |
| 309 | return uint32(0), err |
| 310 | } |
| 311 | if par.Type != params.TID { |
| 312 | return uint32(0), fmt.Errorf("%q parameter is not a TID", params.ThreadID) |
| 313 | } |
| 314 | v, ok := par.Value.(uint32) |
| 315 | if !ok { |
| 316 | return uint32(0), fmt.Errorf("unable to type cast %q parameter to uint32 value from tid", params.ThreadID) |
| 317 | } |
| 318 | return v, nil |
| 319 | } |
| 320 | |
| 321 | // MustGetTid returns the thread id from the parameter or panics if an error occurs. |
| 322 | func (pars Params) MustGetTid() uint32 { |
no test coverage detected