Skip to content

Commit 257c97c

Browse files
authored
non-empty stderr for go list is not an error in itself (#1981)
1 parent ac8334d commit 257c97c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

golist.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func listPackages(ctx context.Context, dir string, env []string, args ...string)
2222
var stderrBuf bytes.Buffer
2323
cmd.Stderr = &stderrBuf
2424
defer func() {
25-
if stderrBuf.Len() > 0 {
25+
if (finalErr != nil) && (stderrBuf.Len() > 0) {
2626
finalErr = fmt.Errorf("%v\n%s", finalErr, stderrBuf.Bytes())
2727
}
2828
}()

0 commit comments

Comments
 (0)