Skip to content

Commit

Permalink
cephfs: avoid variable shadowing
Browse files Browse the repository at this point in the history
Avoiding variable shadowing as it
becomes hard to debug this kind of
issues in real enviroment.

Signed-off-by: Madhu Rajanna <[email protected]>
  • Loading branch information
Madhu-1 committed Nov 8, 2023
1 parent 58feb6f commit cadcb5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/cephfs/core/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit cadcb5a

Please sign in to comment.