From 52f9dcc0a74a7e8acb9b44bec958f212011f6a72 Mon Sep 17 00:00:00 2001 From: "Sahdev P. Zala" Date: Wed, 17 Apr 2019 13:43:14 -0400 Subject: [PATCH] test: fix unconvert errors Fix unconvert errors related to unnecessary type conversions. --- clientv3/concurrency/session.go | 2 +- clientv3/integration/lease_test.go | 2 +- clientv3/mirror/syncer.go | 2 +- clientv3/options.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/clientv3/concurrency/session.go b/clientv3/concurrency/session.go index 04a34ed8acc1..7c747183a56b 100644 --- a/clientv3/concurrency/session.go +++ b/clientv3/concurrency/session.go @@ -47,7 +47,7 @@ func NewSession(client *v3.Client, opts ...SessionOption) (*Session, error) { if err != nil { return nil, err } - id = v3.LeaseID(resp.ID) + id = resp.ID } ctx, cancel := context.WithCancel(ops.ctx) diff --git a/clientv3/integration/lease_test.go b/clientv3/integration/lease_test.go index 7b8de85ddf98..2b77587676a5 100644 --- a/clientv3/integration/lease_test.go +++ b/clientv3/integration/lease_test.go @@ -86,7 +86,7 @@ func TestLeaseRevoke(t *testing.T) { t.Errorf("failed to create lease %v", err) } - _, err = lapi.Revoke(context.Background(), clientv3.LeaseID(resp.ID)) + _, err = lapi.Revoke(context.Background(), resp.ID) if err != nil { t.Errorf("failed to revoke lease %v", err) } diff --git a/clientv3/mirror/syncer.go b/clientv3/mirror/syncer.go index 38d6838bb657..86e03c106f30 100644 --- a/clientv3/mirror/syncer.go +++ b/clientv3/mirror/syncer.go @@ -90,7 +90,7 @@ func (s *syncer) SyncBase(ctx context.Context) (<-chan clientv3.GetResponse, cha return } - respchan <- (clientv3.GetResponse)(*resp) + respchan <- *resp if !resp.More { return diff --git a/clientv3/options.go b/clientv3/options.go index 4660acea067f..aceff31971ba 100644 --- a/clientv3/options.go +++ b/clientv3/options.go @@ -47,7 +47,7 @@ var ( // client-side streaming retry limit, only applied to requests where server responds with // a error code clearly indicating it was unable to process the request such as codes.Unavailable. // If set to 0, retry is disabled. - defaultStreamMaxRetries = uint(^uint(0)) // max uint + defaultStreamMaxRetries = uint(0) // max uint // client-side retry backoff wait between requests. defaultBackoffWaitBetween = 25 * time.Millisecond