Skip to content

Commit

Permalink
optimize return
Browse files Browse the repository at this point in the history
  • Loading branch information
xjlgod committed Feb 28, 2022
1 parent dd177ea commit f134df7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/csv/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ func CountLines(path string, withHeader bool) (int64, error) {
}
return int64(count), nil
case err != nil:
if withHeader && count > 0 {
count--
}
return int64(count), err
return 0, err
}
}
}

0 comments on commit f134df7

Please sign in to comment.