Merge pull request #79 from diamondburned/master

Fix io/fs File leak
This commit is contained in:
Leonel Quinteros 2023-08-29 12:43:10 -03:00 committed by GitHub
commit 5680cf25e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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