forked from mirror/redis
Fix go vet
This commit is contained in:
parent
e9e73a92c0
commit
852a60d520
|
@ -208,7 +208,11 @@ func BenchmarkZAdd(b *testing.B) {
|
|||
|
||||
b.RunParallel(func(pb *testing.PB) {
|
||||
for pb.Next() {
|
||||
if err := client.ZAdd("key", redis.Z{float64(1), "hello"}).Err(); err != nil {
|
||||
err := client.ZAdd("key", redis.Z{
|
||||
Score: float64(1),
|
||||
Member: "hello",
|
||||
}).Err()
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,9 +123,37 @@ func startCluster(scenario *clusterScenario) error {
|
|||
return err
|
||||
}
|
||||
wanted := []redis.ClusterSlot{
|
||||
{0, 4999, []redis.ClusterNode{{"", "127.0.0.1:8220"}, {"", "127.0.0.1:8223"}}},
|
||||
{5000, 9999, []redis.ClusterNode{{"", "127.0.0.1:8221"}, {"", "127.0.0.1:8224"}}},
|
||||
{10000, 16383, []redis.ClusterNode{{"", "127.0.0.1:8222"}, {"", "127.0.0.1:8225"}}},
|
||||
{
|
||||
Start: 0,
|
||||
End: 4999,
|
||||
Nodes: []redis.ClusterNode{{
|
||||
Id: "",
|
||||
Addr: "127.0.0.1:8220",
|
||||
}, {
|
||||
Id: "",
|
||||
Addr: "127.0.0.1:8223",
|
||||
}},
|
||||
}, {
|
||||
Start: 5000,
|
||||
End: 9999,
|
||||
Nodes: []redis.ClusterNode{{
|
||||
Id: "",
|
||||
Addr: "127.0.0.1:8221",
|
||||
}, {
|
||||
Id: "",
|
||||
Addr: "127.0.0.1:8224",
|
||||
}},
|
||||
}, {
|
||||
Start: 10000,
|
||||
End: 16383,
|
||||
Nodes: []redis.ClusterNode{{
|
||||
Id: "",
|
||||
Addr: "127.0.0.1:8222",
|
||||
}, {
|
||||
Id: "",
|
||||
Addr: "127.0.0.1:8225",
|
||||
}},
|
||||
},
|
||||
}
|
||||
return assertSlotsEqual(res, wanted)
|
||||
}, 30*time.Second)
|
||||
|
@ -492,9 +520,37 @@ var _ = Describe("ClusterClient", func() {
|
|||
Expect(res).To(HaveLen(3))
|
||||
|
||||
wanted := []redis.ClusterSlot{
|
||||
{0, 4999, []redis.ClusterNode{{"", "127.0.0.1:8220"}, {"", "127.0.0.1:8223"}}},
|
||||
{5000, 9999, []redis.ClusterNode{{"", "127.0.0.1:8221"}, {"", "127.0.0.1:8224"}}},
|
||||
{10000, 16383, []redis.ClusterNode{{"", "127.0.0.1:8222"}, {"", "127.0.0.1:8225"}}},
|
||||
{
|
||||
Start: 0,
|
||||
End: 4999,
|
||||
Nodes: []redis.ClusterNode{{
|
||||
Id: "",
|
||||
Addr: "127.0.0.1:8220",
|
||||
}, {
|
||||
Id: "",
|
||||
Addr: "127.0.0.1:8223",
|
||||
}},
|
||||
}, {
|
||||
Start: 5000,
|
||||
End: 9999,
|
||||
Nodes: []redis.ClusterNode{{
|
||||
Id: "",
|
||||
Addr: "127.0.0.1:8221",
|
||||
}, {
|
||||
Id: "",
|
||||
Addr: "127.0.0.1:8224",
|
||||
}},
|
||||
}, {
|
||||
Start: 10000,
|
||||
End: 16383,
|
||||
Nodes: []redis.ClusterNode{{
|
||||
Id: "",
|
||||
Addr: "127.0.0.1:8222",
|
||||
}, {
|
||||
Id: "",
|
||||
Addr: "127.0.0.1:8225",
|
||||
}},
|
||||
},
|
||||
}
|
||||
Expect(assertSlotsEqual(res, wanted)).NotTo(HaveOccurred())
|
||||
})
|
||||
|
|
695
commands_test.go
695
commands_test.go
File diff suppressed because it is too large
Load Diff
|
@ -24,7 +24,7 @@ func Example_instrumentation() {
|
|||
// finished processing: <ping: PONG>
|
||||
}
|
||||
|
||||
func Example_Pipeline_instrumentation() {
|
||||
func ExamplePipeline_instrumentation() {
|
||||
client := redis.NewClient(&redis.Options{
|
||||
Addr: ":6379",
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue