Don't pass empty row to channel on error
This commit is contained in:
parent
6a86de87b4
commit
d77f3fe012
@ -27,7 +27,8 @@ func (storageFetcher CsvTailStorageFetcher) FetchStorageDiffs(out chan<- utils.S
|
|||||||
row, parseErr := utils.FromStrings(strings.Split(line.Text, ","))
|
row, parseErr := utils.FromStrings(strings.Split(line.Text, ","))
|
||||||
if parseErr != nil {
|
if parseErr != nil {
|
||||||
errs <- parseErr
|
errs <- parseErr
|
||||||
|
} else {
|
||||||
|
out <- row
|
||||||
}
|
}
|
||||||
out <- row
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,12 @@ var _ = Describe("Csv Tail Storage Fetcher", func() {
|
|||||||
mockTailer.Lines <- line
|
mockTailer.Lines <- line
|
||||||
|
|
||||||
Expect(<-errorsChannel).To(HaveOccurred())
|
Expect(<-errorsChannel).To(HaveOccurred())
|
||||||
|
select {
|
||||||
|
case <-rowsChannel:
|
||||||
|
Fail("value passed to rows channel on error")
|
||||||
|
default:
|
||||||
|
Succeed()
|
||||||
|
}
|
||||||
close(done)
|
close(done)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user