// Parse new errors.
errors := make(map[int]map[string]bool)
tmpRe := regexp.MustCompile(`autotmp_\d+`)
+ fileRe := regexp.MustCompile(`(\.go):\d+:`)
for _, errStr := range splitOutput(out, false) {
- errFile, rest, ok := strings.Cut(errStr, ":")
- if !ok || errFile != file {
+ m := fileRe.FindStringSubmatchIndex(errStr)
+ if len(m) != 4 {
+ continue
+ }
+ // The end of the file is the end of the first and only submatch.
+ errFile := errStr[:m[3]]
+ rest := errStr[m[3]+1:]
+ if errFile != file {
continue
}
lineStr, msg, ok := strings.Cut(rest, ":")