fix: typo and error handle

refactor/fs
Noah Hsu 2022-06-21 16:25:45 +08:00
parent 55d6434daa
commit 9633af4e25
2 changed files with 4 additions and 1 deletions

View File

@ -20,7 +20,7 @@ func Move(ctx context.Context, account driver.Driver, srcPath, dstPath string) e
if err != nil {
return errors.WithMessage(err, "failed get src account")
}
dstAccount, dstActualPath, err := operations.GetAccountAndActualPath(srcPath)
dstAccount, dstActualPath, err := operations.GetAccountAndActualPath(dstPath)
if err != nil {
return errors.WithMessage(err, "failed get dst account")
}

View File

@ -151,6 +151,9 @@ func Move(ctx context.Context, account driver.Driver, srcPath, dstPath string) e
return errors.WithMessage(err, "failed to get src object")
}
dstDir, err := Get(ctx, account, stdpath.Dir(dstPath))
if err != nil {
return errors.WithMessage(err, "failed to get dst dir")
}
return account.Move(ctx, srcObj, dstDir)
}