From 060c8dfff092f732aef79b9b46a46e32d07578ee Mon Sep 17 00:00:00 2001 From: zzr93 <34027824+zzr93@users.noreply.github.com> Date: Mon, 4 Jul 2022 17:18:04 +0800 Subject: [PATCH] operations: use correct src/dst in some log messages Most of the time this will make no difference to user logs, however the difference may be visible in JSON logs and on the rare occasions src and dst are pointing to different file names. --- fs/operations/operations.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/operations/operations.go b/fs/operations/operations.go index 1ea41853f..e00a20a9e 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -89,7 +89,7 @@ func checkHashes(ctx context.Context, src fs.ObjectInfo, dst fs.Object, ht hash. return dstErr } if dstHash == "" { - fs.Debugf(src, "Dst hash empty - aborting Src hash check") + fs.Debugf(dst, "Dst hash empty - aborting Src hash check") return errNoHash } return nil @@ -100,11 +100,11 @@ func checkHashes(ctx context.Context, src fs.ObjectInfo, dst fs.Object, ht hash. } if srcErr != nil { err = fs.CountError(srcErr) - fs.Errorf(dst, "Failed to calculate src hash: %v", err) + fs.Errorf(src, "Failed to calculate src hash: %v", err) } if dstErr != nil { err = fs.CountError(dstErr) - fs.Errorf(src, "Failed to calculate dst hash: %v", err) + fs.Errorf(dst, "Failed to calculate dst hash: %v", err) } if err != nil { return false, ht, srcHash, dstHash, err