From 1b39b82a851379e301bfef4b1116b477344f3741 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 2 Nov 2023 11:46:57 +0100 Subject: [PATCH] cephfs: avoid variable shadowing Avoiding variable shadowing as it becomes hard to debug this kind of issues in real enviroment. Signed-off-by: Madhu Rajanna --- internal/cephfs/core/clone.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/cephfs/core/clone.go b/internal/cephfs/core/clone.go index 09352543f..6ec18db94 100644 --- a/internal/cephfs/core/clone.go +++ b/internal/cephfs/core/clone.go @@ -157,7 +157,9 @@ func (s *subVolumeClient) CreateCloneFromSnapshot( } } }() - cloneState, err := s.GetCloneState(ctx) + var cloneState cephFSCloneState + // avoid err variable shadowing + cloneState, err = s.GetCloneState(ctx) if err != nil { log.ErrorLog(ctx, "failed to get clone state: %v", err)