Skip to content

Commit

Permalink
fix: dont leave the file open on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
luisdavim committed May 22, 2022
1 parent 21755a5 commit 4434f45
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions gotenv.go
Expand Up @@ -68,11 +68,10 @@ func loadenv(override bool, filenames ...string) error {
}

err = parset(f, override)
f.Close()
if err != nil {
return err
}

f.Close()
}

return nil
Expand Down

0 comments on commit 4434f45

Please sign in to comment.