Skip to content

Commit

Permalink
- restore defer file.Close
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Ninucci committed Aug 17, 2023
1 parent 9355c8a commit 30a9f96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sireneUL.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func sireneULFromCsv(row []string) SireneUL {

func parseSireneUL(ctx context.Context, file io.ReadCloser, s chan SireneUL) {
c := csv.NewReader(file)
defer file.Close()

if head, err := c.Read(); checkHeader(SireneULHeaders, head) && err != nil {
s <- SireneUL{err: err}
Expand All @@ -45,7 +46,6 @@ func parseSireneUL(ctx context.Context, file io.ReadCloser, s chan SireneUL) {
row, err := c.Read()
if err != nil {
if err == io.EOF {
err := file.Close()
if err != nil {
s <- SireneUL{err: err}
}
Expand Down

0 comments on commit 30a9f96

Please sign in to comment.