From 939b4f8599f617541e1f1121167df22ecabddf89 Mon Sep 17 00:00:00 2001 From: zhoulin xie Date: Sun, 10 Mar 2019 01:08:06 +0800 Subject: [PATCH] clientv3/balancer/grpc1.7-health.go: Fix variable spelling error Signed-off-by: zhoulin xie --- clientv3/balancer/grpc1.7-health.go | 6 +++--- clientv3/balancer/grpc1.7-health_test.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/clientv3/balancer/grpc1.7-health.go b/clientv3/balancer/grpc1.7-health.go index 7d24b93f628..2153767354d 100644 --- a/clientv3/balancer/grpc1.7-health.go +++ b/clientv3/balancer/grpc1.7-health.go @@ -38,10 +38,10 @@ const ( unknownService = "unknown service grpc.health.v1.Health" ) -// ErrNoAddrAvilable is returned by Get() when the balancer does not have +// ErrNoAddrAvailable is returned by Get() when the balancer does not have // any active connection to endpoints at the time. // This error is returned only when opts.BlockingWait is true. -var ErrNoAddrAvilable = status.Error(codes.Unavailable, "there is no address available") +var ErrNoAddrAvailable = status.Error(codes.Unavailable, "there is no address available") type NotifyMsg int @@ -510,7 +510,7 @@ func (b *GRPC17Health) Get(ctx context.Context, opts grpc.BalancerGetOptions) (g return grpc.Address{Addr: ""}, nil, grpc.ErrClientConnClosing } if addr == "" { - return grpc.Address{Addr: ""}, nil, ErrNoAddrAvilable + return grpc.Address{Addr: ""}, nil, ErrNoAddrAvailable } return grpc.Address{Addr: addr}, func() {}, nil } diff --git a/clientv3/balancer/grpc1.7-health_test.go b/clientv3/balancer/grpc1.7-health_test.go index bb4f7b8a861..186de7a36d6 100644 --- a/clientv3/balancer/grpc1.7-health_test.go +++ b/clientv3/balancer/grpc1.7-health_test.go @@ -39,7 +39,7 @@ func TestOldHealthBalancerGetUnblocking(t *testing.T) { unblockingOpts := grpc.BalancerGetOptions{BlockingWait: false} _, _, err := hb.Get(context.Background(), unblockingOpts) - if err != ErrNoAddrAvilable { + if err != ErrNoAddrAvailable { t.Errorf("Get() with no up endpoints should return ErrNoAddrAvailable, got: %v", err) } @@ -69,7 +69,7 @@ func TestOldHealthBalancerGetUnblocking(t *testing.T) { } down2(errors.New("error")) _, _, err = hb.Get(context.Background(), unblockingOpts) - if err != ErrNoAddrAvilable { + if err != ErrNoAddrAvailable { t.Errorf("Get() with no up endpoints should return ErrNoAddrAvailable, got: %v", err) } }