Skip to content

Commit 5c7c133

Browse files
committed
chore: remove a redundant method from Ring
Signed-off-by: fukua95 <[email protected]>
1 parent eb40ac8 commit 5c7c133

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ring.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -563,13 +563,6 @@ func (c *Ring) SetAddrs(addrs map[string]string) {
563563
c.sharding.SetAddrs(addrs)
564564
}
565565

566-
// Do create a Cmd from the args and processes the cmd.
567-
func (c *Ring) Do(ctx context.Context, args ...interface{}) *Cmd {
568-
cmd := NewCmd(ctx, args...)
569-
_ = c.Process(ctx, cmd)
570-
return cmd
571-
}
572-
573566
func (c *Ring) Process(ctx context.Context, cmd Cmder) error {
574567
err := c.processHook(ctx, cmd)
575568
cmd.SetErr(err)

ring_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ var _ = Describe("Redis Ring", func() {
7474
Expect(ring.Close()).NotTo(HaveOccurred())
7575
})
7676

77+
It("do", func() {
78+
ctx := context.Background()
79+
80+
err := ring.Do(ctx, "ping").Err()
81+
Expect(err).NotTo(HaveOccurred())
82+
})
83+
7784
It("supports context", func() {
7885
ctx, cancel := context.WithCancel(ctx)
7986
cancel()

0 commit comments

Comments
 (0)