Skip to content

Commit 4e20082

Browse files
committed
Fix io/fs File leak
1 parent db315c3 commit 4e20082

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)