提交
This commit is contained in:
15
pkg/integral/file.go
Normal file
15
pkg/integral/file.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package integral
|
||||
|
||||
import "os"
|
||||
|
||||
//PathExists 路径是否存在
|
||||
func PathExists(path string) (bool, error) {
|
||||
_, err := os.Stat(path)
|
||||
if err == nil {
|
||||
return true, nil
|
||||
}
|
||||
if os.IsNotExist(err) {
|
||||
return false, nil
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
Reference in New Issue
Block a user