From 19eb13733b48dc39bbff2f8e1867ba463b4b874c 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 1feeccd85f16..96ff22ded1e6 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)