mirror of
https://github.com/cloudreve/cloudreve.git
synced 2025-10-29 15:47:45 +08:00
14 lines
227 B
Go
14 lines
227 B
Go
package util
|
|
|
|
import "os"
|
|
|
|
// Exists reports whether the named file or directory exists.
|
|
func Exists(name string) bool {
|
|
if _, err := os.Stat(name); err != nil {
|
|
if os.IsNotExist(err) {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
}
|