Explorar o código

Update file_operations.go

v_zhibsong %!s(int64=4) %!d(string=hai) anos
pai
achega
15c47ddeb9
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      server/utils/file_operations.go

+ 5 - 1
server/utils/file_operations.go

@@ -56,7 +56,11 @@ func FileMove(src string, dst string) error {
 	//		return err
 	//	}
 	//}
-	err = fileMove(src, filepath.Join(dst, filepath.Base(dst)))
+	nDst := filepath.Join(dst, filepath.Base(dst))
+	if src == nDst {
+		return nil
+	}
+	err = fileMove(src, nDst)
 	if err != nil {
 		return err
 	}