mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
clientv3/concurrency: remove the unneeded slash
Since NewMutex will append a slash to pfx, there is no need to append a slash beforehand.
This commit is contained in:
parent
838315283d
commit
e53298afb1
@ -36,14 +36,14 @@ func ExampleMutex_TryLock() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer s1.Close()
|
||||
m1 := concurrency.NewMutex(s1, "/my-lock/")
|
||||
m1 := concurrency.NewMutex(s1, "/my-lock")
|
||||
|
||||
s2, err := concurrency.NewSession(cli)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer s2.Close()
|
||||
m2 := concurrency.NewMutex(s2, "/my-lock/")
|
||||
m2 := concurrency.NewMutex(s2, "/my-lock")
|
||||
|
||||
// acquire lock for s1
|
||||
if err = m1.Lock(context.TODO()); err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user