From 3b91648070e520f8108521b3735fe676b9d84083 Mon Sep 17 00:00:00 2001 From: davygeek Date: Wed, 29 Jun 2016 13:21:49 +0800 Subject: [PATCH] client: follow golint notice change errors.New to fmt.Errorf and use 'var eps []string' instead 'var make([]string, 0)' --- client/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/client.go b/client/client.go index 2aaa112ed..fd822bb70 100644 --- a/client/client.go +++ b/client/client.go @@ -301,7 +301,7 @@ func (c *httpClusterClient) SetEndpoints(eps []string) error { // If endpoints doesn't have the lu, just keep c.pinned = 0. // Forwarding between follower and leader would be required but it works. default: - return errors.New(fmt.Sprintf("invalid endpoint selection mode: %d", c.selectionMode)) + return fmt.Errorf("invalid endpoint selection mode: %d", c.selectionMode) } return nil @@ -393,7 +393,7 @@ func (c *httpClusterClient) Sync(ctx context.Context) error { c.Lock() defer c.Unlock() - eps := make([]string, 0) + var eps []string for _, m := range ms { eps = append(eps, m.ClientURLs...) }