Improve error message for failed file copied (#30418)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d7d8b4163e
Коммит
2e44a6a1ed
@@ -59,8 +59,14 @@ func CopyFile(src, dst string) (err error) {
|
|||||||
// src must exist and dst must not exist.
|
// src must exist and dst must not exist.
|
||||||
// Permissions are preserved when possible. Symlinks are skipped.
|
// Permissions are preserved when possible. Symlinks are skipped.
|
||||||
func CopyDir(src string, dst string) (err error) {
|
func CopyDir(src string, dst string) (err error) {
|
||||||
src = filepath.Clean(src)
|
src, err = filepath.Abs(src)
|
||||||
dst = filepath.Clean(dst)
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dst, err = filepath.Abs(dst)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
stat, err := os.Stat(src)
|
stat, err := os.Stat(src)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user