Skip to content
Browse files

SLAVEOF command now accepts a string type as its second paramater. fix

  • Loading branch information...
1 parent 6f5f6d6 commit 9736bc4688d86cd8e967647c57dda862c441b8b0 Simon Zimmermann committed Jan 17, 2012
Showing with 8 additions and 4 deletions.
  1. +2 −2 commands.go
  2. +6 −2 commands_test.go
View
4 commands.go
@@ -664,8 +664,8 @@ func (c *Client) Save() error {
}
// Change the replication settings of a slave on the fly
-func (c *Client) Slaveof(host string, port int) error {
- return SendStr(c.Rw, "SLAVEOF", host, strconv.Itoa(port)).nilOrErr()
+func (c *Client) Slaveof(host string, port string) error {
+ return SendStr(c.Rw, "SLAVEOF", host, port).nilOrErr()
}
// TODO
View
8 commands_test.go
@@ -611,9 +611,13 @@ func TestServer(t *testing.T) {
error_(t, "monitor", nil, res, err)
}
- // Running this command don't bother to test each time
+ // Don't bother to test each time
// since it changes the state of server.
- //if err := c.Slaveof("localhost", 6378); err != nil {
+ //if err := c.Slaveof("localhost", "6379"); err != nil {
+ // error_(t, "slavof", nil, nil, err)
+ //}
+ //
+ //if err := c.Slaveof("localhost", "NO ONE"); err != nil {
// error_(t, "slavof", nil, nil, err)
//}
}

0 comments on commit 9736bc4

Please sign in to comment.
Something went wrong with that request. Please try again.