Skip to content

Commit

Permalink
non-empty stderr for go list is not an error in itself
Browse files Browse the repository at this point in the history
  • Loading branch information
atercattus committed Feb 18, 2025
1 parent 94ff0fc commit bc1a2c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion golist.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func listPackages(ctx context.Context, dir string, env []string, args ...string)
var stderrBuf bytes.Buffer
cmd.Stderr = &stderrBuf
defer func() {
if stderrBuf.Len() > 0 {
if (finalErr != nil) && (stderrBuf.Len() > 0) {
finalErr = fmt.Errorf("%v\n%s", finalErr, stderrBuf.Bytes())
}
}()
Expand Down

0 comments on commit bc1a2c1

Please sign in to comment.