diff --git a/commands.go b/commands.go index 3953859..2d8a28d 100644 --- a/commands.go +++ b/commands.go @@ -2068,12 +2068,14 @@ func (c *cmdable) ClientID() *IntCmd { return cmd } -func (c *cmdable) ClientUnblock(id int64, isError bool) *IntCmd { - args := []interface{}{"client", "unblock", id} - if isError { - args = append(args, "error") - } - cmd := NewIntCmd(args...) +func (c *cmdable) ClientUnblock(id int64) *IntCmd { + cmd := NewIntCmd("client", "unblock", id) + c.process(cmd) + return cmd +} + +func (c *cmdable) ClientUnblockWithError(id int64) *IntCmd { + cmd := NewIntCmd("client", "unblock", id, "error") c.process(cmd) return cmd } diff --git a/commands_test.go b/commands_test.go index 70e6af7..ef37b87 100644 --- a/commands_test.go +++ b/commands_test.go @@ -129,7 +129,14 @@ var _ = Describe("Commands", func() { It("should ClientUnblock", func() { id := client.ClientID().Val() - r, err := client.ClientUnblock(id, true).Result() + r, err := client.ClientUnblock(id).Result() + Expect(err).NotTo(HaveOccurred()) + Expect(r).To(Equal(int64(0))) + }) + + It("should ClientUnblockWithError", func() { + id := client.ClientID().Val() + r, err := client.ClientUnblockWithError(id).Result() Expect(err).NotTo(HaveOccurred()) Expect(r).To(Equal(int64(0))) })