We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5dd0fe2 commit ccacbd1Copy full SHA for ccacbd1
common/path.go
@@ -17,17 +17,16 @@
17
package common
18
19
import (
20
+ "errors"
21
+ "io/fs"
22
"os"
23
"path/filepath"
24
)
25
26
// FileExist checks if a file exists at filePath.
27
func FileExist(filePath string) bool {
28
_, err := os.Stat(filePath)
- if err != nil && os.IsNotExist(err) {
- return false
29
- }
30
- return true
+ return !errors.Is(err, fs.ErrNotExist)
31
}
32
33
// AbsolutePath returns datadir + filename, or filename if it is absolute.
0 commit comments