"Regular expression evaluation (pattern.exec(data)) must be repeated until there are no more matches in order to collect all matches for a multi-line body of text. The loop continues until there are no more matches (we have reached the end of the error text)."

Ok, I took a slightly different approach in go build, I chose to split the text at the return carriage and process each line separately since there should never be 2 errors on the same line.
Couldn't there be a situation where you don't get a match but the data isn't over, for instance a comment line or an empty line? Also, out of curiosity, is JS mutating `data` when you do a pattern match?