Fix io/fs File leak

This commit is contained in:
diamondburned 2023-05-29 15:56:15 -07:00
parent db315c3450
commit 4e20082713
No known key found for this signature in database
GPG key ID: D78C4471CE776659

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