MCPcopy Create free account
hub / github.com/GoTestTools/gotestfmt / getTimeElapsed

Function getTimeElapsed

tokenizer/tokenizer.go:483–489  ·  view source on GitHub ↗
(r *regexp.Regexp, match [][]byte, name string)

Source from the content-addressed store, hash-verified

481}
482
483func 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
491func extract(r *regexp.Regexp, match [][]byte, name string) []byte {
492 idx := r.SubexpIndex(name)

Callers 1

parseLineFunction · 0.85

Calls 1

extractFunction · 0.85

Tested by

no test coverage detected