Skip to content

Commit

Permalink
Fix io/fs File leak
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed May 29, 2023
1 parent db315c3 commit 4e20082
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions locale.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,8 @@ func (l *Locale) findExt(dom, ext string) string {

func (l *Locale) fileExists(filename string) bool {
if l.fs != nil {
f, err := l.fs.Open(filename)
if err != nil {
return false
}
_, err = f.Stat()
_, err := fs.Stat(l.fs, filename)
return err == nil

}
_, err := os.Stat(filename)
return err == nil
Expand Down

0 comments on commit 4e20082

Please sign in to comment.