mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +00:00
Update FileExist to use errors.Is for checking existence
This commit is contained in:
parent
f7127d6ce1
commit
03e8e4b2e2
1 changed files with 1 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue