fix:#796 补充

This commit is contained in:
songzhibin97
2021-10-22 16:23:35 +08:00
parent 1f0cd6ef98
commit e059a7e84d
3 changed files with 17 additions and 5 deletions

View File

@@ -1,7 +1,6 @@
package utils
import (
"errors"
"os"
"path/filepath"
"reflect"
@@ -26,10 +25,6 @@ func FileMove(src string, dst string) (err error) {
if err != nil {
return err
}
_, err = os.Stat(dst)
if err == nil {
return errors.New("文件已存在")
}
var revoke = false
dir := filepath.Dir(dst)
Redirect:
@@ -71,3 +66,9 @@ func TrimSpace(target interface{}) {
}
}
}
// FileExist 判断文件是否存在
func FileExist(path string) bool {
_, err := os.Lstat(path)
return !os.IsNotExist(err)
}