MustGetTid returns the thread id from the parameter or panics if an error occurs.
()
| 320 | |
| 321 | // MustGetTid returns the thread id from the parameter or panics if an error occurs. |
| 322 | func (pars Params) MustGetTid() uint32 { |
| 323 | par, err := pars.findParam(params.ThreadID) |
| 324 | if err != nil { |
| 325 | panic(err) |
| 326 | } |
| 327 | if par.Type != params.TID { |
| 328 | panic(fmt.Errorf("%q parameter is not a TID", params.ThreadID)) |
| 329 | } |
| 330 | v, ok := par.Value.(uint32) |
| 331 | if !ok { |
| 332 | panic(fmt.Errorf("unable to type cast %q parameter to uint32 value from tid", params.ThreadID)) |
| 333 | } |
| 334 | return v |
| 335 | } |
| 336 | |
| 337 | // GetUint8 returns the underlying uint8 value from the parameter. |
| 338 | func (pars Params) GetUint8(name string) (uint8, error) { |