test: skip "# package/path" output from cmd/go in errchk

This allows errchk to be used with "go vet" output (as opposed to "go tool vet").

Change-Id: I0009a53c9cb74accd5bd3923c137d6dbf9e46326
Reviewed-on: https://go-review.googlesource.com/83836
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Russ Cox 2017-12-13 14:38:58 -05:00
parent de14b2f638
commit c6ea277ac1
1 changed files with 3 additions and 0 deletions

View File

@ -65,6 +65,9 @@ $out = join('', <CMD>);
close CMD;
# Remove lines beginning with #, printed by go command to indicate package.
@out = grep {!/^#/} @out;
if($exitcode != 0 && $? == 0) {
print STDERR "BUG: errchk: command succeeded unexpectedly\n";
print STDERR @out;