Skip to content

Commit

Permalink
Merge pull request #79 from diamondburned/master
Browse files Browse the repository at this point in the history
Fix io/fs File leak
  • Loading branch information
leonelquinteros committed Aug 29, 2023
2 parents d32dc82 + 4e20082 commit 5680cf2
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions locale.go
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 5680cf2

Please sign in to comment.