(r *regexp.Regexp, match [][]byte, name string)
| 481 | } |
| 482 | |
| 483 | func getTimeElapsed(r *regexp.Regexp, match [][]byte, name string) (time.Duration, error) { |
| 484 | val := extract(r, match, name) |
| 485 | if val == nil { |
| 486 | return 0, nil |
| 487 | } |
| 488 | return time.ParseDuration(string(val)) |
| 489 | } |
| 490 | |
| 491 | func extract(r *regexp.Regexp, match [][]byte, name string) []byte { |
| 492 | idx := r.SubexpIndex(name) |