Update path.go

This commit is contained in:
Coder 2025-10-20 15:30:04 +02:00 committed by GitHub
parent b1809d13d1
commit f7127d6ce1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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