From dc24d98c71c7def95cac57357b7ea2a111da02ef Mon Sep 17 00:00:00 2001 From: Andrii Kushch Date: Thu, 11 Oct 2018 12:53:40 +0200 Subject: [PATCH 1/4] remove redundant expression --- redis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis.go b/redis.go index 8fa85dd..6405671 100644 --- a/redis.go +++ b/redis.go @@ -323,7 +323,7 @@ func txPipelineReadQueued(rd *proto.Reader, cmds []Cmder) error { return err } - for _ = range cmds { + for range cmds { err = statusCmd.readReply(rd) if err != nil && !internal.IsRedisError(err) { return err From f87c59c1913a4e00f573aee847e2e99eb098246e Mon Sep 17 00:00:00 2001 From: Andrii Kushch Date: Thu, 11 Oct 2018 12:54:30 +0200 Subject: [PATCH 2/4] remove redundant type declaration --- commands_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands_test.go b/commands_test.go index d0c8e57..656cced 100644 --- a/commands_test.go +++ b/commands_test.go @@ -1958,7 +1958,7 @@ var _ = Describe("Commands", func() { sMembersMap := client.SMembersMap("set") Expect(sMembersMap.Err()).NotTo(HaveOccurred()) - Expect(sMembersMap.Val()).To(Equal(map[string]struct{}{"Hello": struct{}{}, "World": struct{}{}})) + Expect(sMembersMap.Val()).To(Equal(map[string]struct{}{"Hello": {}, "World": {}})) }) It("should SMove", func() { From f5d67d80d35cc36d3271c411ef4d8c2a870a05bf Mon Sep 17 00:00:00 2001 From: Andrii Kushch Date: Thu, 11 Oct 2018 12:55:35 +0200 Subject: [PATCH 3/4] remove unused function --- internal/proto/reader_test.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/internal/proto/reader_test.go b/internal/proto/reader_test.go index 54e85af..c4a4c12 100644 --- a/internal/proto/reader_test.go +++ b/internal/proto/reader_test.go @@ -2,16 +2,11 @@ package proto_test import ( "bytes" - "strings" "testing" "github.com/go-redis/redis/internal/proto" ) -func newReader(s string) *proto.Reader { - return proto.NewReader(strings.NewReader(s)) -} - func BenchmarkReader_ParseReply_Status(b *testing.B) { benchmarkParseReply(b, "+OK\r\n", nil, false) } From 2d74cf3b10ba12a5b15cce6349bce578c19a0060 Mon Sep 17 00:00:00 2001 From: Andrii Kushch Date: Thu, 11 Oct 2018 12:58:31 +0200 Subject: [PATCH 4/4] remove snake case use --- cluster_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cluster_test.go b/cluster_test.go index 9a1d55f..b8003ba 100644 --- a/cluster_test.go +++ b/cluster_test.go @@ -208,11 +208,11 @@ func startCluster(scenario *clusterScenario) error { } func assertSlotsEqual(slots, wanted []redis.ClusterSlot) error { -outer_loop: +outerLoop: for _, s2 := range wanted { for _, s1 := range slots { if slotEqual(s1, s2) { - continue outer_loop + continue outerLoop } } return fmt.Errorf("%v not found in %v", s2, slots)