Update FileExist to use errors.Is for checking existence

This commit is contained in:
Felix Lange 2025-10-24 17:23:32 +02:00 committed by GitHub
parent f7127d6ce1
commit 03e8e4b2e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,7 +24,7 @@ import (
// FileExist checks if a file exists at filePath.
func FileExist(filePath string) bool {
_, err := os.Stat(filePath)
return !os.IsNotExist(err)
return !errors.Is(err, fs.ErrNotExist)
}
// AbsolutePath returns datadir + filename, or filename if it is absolute.