Skip to content

Commit 5680cf2

Browse files
Merge pull request #79 from diamondburned/master
Fix io/fs File leak
2 parents d32dc82 + 4e20082 commit 5680cf2

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

locale.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,8 @@ func (l *Locale) findExt(dom, ext string) string {
113113

114114
func (l *Locale) fileExists(filename string) bool {
115115
if l.fs != nil {
116-
f, err := l.fs.Open(filename)
117-
if err != nil {
118-
return false
119-
}
120-
_, err = f.Stat()
116+
_, err := fs.Stat(l.fs, filename)
121117
return err == nil
122-
123118
}
124119
_, err := os.Stat(filename)
125120
return err == nil

0 commit comments

Comments
 (0)