Skip to content

Commit

Permalink
fix file leak
Browse files Browse the repository at this point in the history
  • Loading branch information
egonelbre committed Feb 10, 2021
1 parent 78aeb2c commit 2049942
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions loc.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func CountLines(path string) (*Count, error) {
if err != nil {
return nil, err
}
defer func() { _ = file.Close() }()

stat, err := file.Stat()
if err != nil {
Expand Down

0 comments on commit 2049942

Please sign in to comment.