Skip to content

Commit

Permalink
Small but important bugfix in prom_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
marcopaganini committed Feb 5, 2024
1 parent 346e49e commit 0b6e4c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func errcheck(ch chan error) error {
var saved error
for i := 0; i < numRecords; i++ {
err := <-ch
if err != nil && saved != nil {
if err != nil && saved == nil {
saved = err
}
}
Expand Down Expand Up @@ -98,9 +98,9 @@ func TestMulti(t *testing.T) {
generate(tmpfile, ch)

if err := errcheck(ch); err != nil {
t.Errorf("TestMulti: error writing textfile: %v", err)
t.Fatalf("TestMulti/errcheck: %v", err)
}
if err := filecheck(t, tmpfile); err != nil {
t.Errorf("TestMulti: file contents error: %v", err)
t.Fatalf("TestMulti/filecheck: %v", err)
}
}

0 comments on commit 0b6e4c3

Please sign in to comment.