Skip to content

Commit

Permalink
Merge pull request #7748 from darasion/master
Browse files Browse the repository at this point in the history
clientv3/namespace: fix incorrect watching prefix-end
  • Loading branch information
xiang90 authored Apr 15, 2017
2 parents e2d0db9 + 0e7fd4a commit 7e3dd74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clientv3/namespace/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// unprefixedKV := cli.KV
// cli.KV = namespace.NewKV(cli.KV, "my-prefix/")
// cli.Watcher = namespace.NewWatcher(cli.Watcher, "my-prefix/")
// cli.Leases = namespace.NewLease(cli.Lease, "my-prefix/")
// cli.Lease = namespace.NewLease(cli.Lease, "my-prefix/")
//
// Now calls using 'cli' will namespace / prefix all keys with "my-prefix/":
//
Expand Down
2 changes: 1 addition & 1 deletion clientv3/namespace/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func NewWatcher(w clientv3.Watcher, prefix string) clientv3.Watcher {

func (w *watcherPrefix) Watch(ctx context.Context, key string, opts ...clientv3.OpOption) clientv3.WatchChan {
// since OpOption is opaque, determine range for prefixing through an OpGet
op := clientv3.OpGet("abc", opts...)
op := clientv3.OpGet(key, opts...)
end := op.RangeBytes()
pfxBegin, pfxEnd := prefixInterval(w.pfx, []byte(key), end)
if pfxEnd != nil {
Expand Down

0 comments on commit 7e3dd74

Please sign in to comment.