Skip to content

Commit

Permalink
Fix issues found by deepsource.io (samuel#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilbhide committed Feb 8, 2020
1 parent f42c1fa commit 3b97264
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions zk/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ func (l *Lock) Lock() error {
for i := 0; i < 3; i++ {
path, err = l.c.CreateProtectedEphemeralSequential(prefix, []byte{}, l.acl)
mapEphermeralSequenceLockPath[l.path] = path
if err == ErrNoNode {
switch err {
case ErrNoNode:
// Create parent node.
parts := strings.Split(l.path, "/")
pth := ""
Expand All @@ -82,9 +83,9 @@ func (l *Lock) Lock() error {
return err
}
}
} else if err == nil {
case nil:
break
} else {
default:
return err
}
}
Expand Down

0 comments on commit 3b97264

Please sign in to comment.