diff --git a/etcdctl/command/format.go b/etcdctl/command/format.go index 9983df26d..f5fb872ae 100644 --- a/etcdctl/command/format.go +++ b/etcdctl/command/format.go @@ -19,7 +19,7 @@ import ( "fmt" "os" - "github.com/coreos/go-etcd/etcd" + "github.com/coreos/etcd/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd" ) // printKey writes the etcd response to STDOUT in the given format. diff --git a/etcdctl/command/get_command.go b/etcdctl/command/get_command.go index 482649fc8..beb391eed 100644 --- a/etcdctl/command/get_command.go +++ b/etcdctl/command/get_command.go @@ -55,7 +55,7 @@ func printGet(resp *etcd.Response, format string) { // getCommandFunc executes the "get" command. func getCommandFunc(c *cli.Context, client *etcd.Client) (*etcd.Response, error) { if len(c.Args()) == 0 { - return nil, errors.New("Key required") + return nil, errors.New("key required") } key := c.Args()[0] sorted := c.Bool("sort") diff --git a/etcdctl/command/mk_command.go b/etcdctl/command/mk_command.go index a2002eb30..95d9b3a40 100644 --- a/etcdctl/command/mk_command.go +++ b/etcdctl/command/mk_command.go @@ -39,12 +39,12 @@ func NewMakeCommand() cli.Command { // makeCommandFunc executes the "make" command. func makeCommandFunc(c *cli.Context, client *etcd.Client) (*etcd.Response, error) { if len(c.Args()) == 0 { - return nil, errors.New("Key required") + return nil, errors.New("key required") } key := c.Args()[0] value, err := argOrStdin(c.Args(), os.Stdin, 1) if err != nil { - return nil, errors.New("Value required") + return nil, errors.New("value required") } ttl := c.Int("ttl") diff --git a/etcdctl/command/mkdir_command.go b/etcdctl/command/mkdir_command.go index 278efc0bf..d86b0eebb 100644 --- a/etcdctl/command/mkdir_command.go +++ b/etcdctl/command/mkdir_command.go @@ -38,7 +38,7 @@ func NewMakeDirCommand() cli.Command { // makeDirCommandFunc executes the "mkdir" command. func makeDirCommandFunc(c *cli.Context, client *etcd.Client) (*etcd.Response, error) { if len(c.Args()) == 0 { - return nil, errors.New("Key required") + return nil, errors.New("key required") } key := c.Args()[0] ttl := c.Int("ttl") diff --git a/etcdctl/command/rm_command.go b/etcdctl/command/rm_command.go index 80a0158a1..c754d4ce0 100644 --- a/etcdctl/command/rm_command.go +++ b/etcdctl/command/rm_command.go @@ -41,7 +41,7 @@ func NewRemoveCommand() cli.Command { // removeCommandFunc executes the "rm" command. func removeCommandFunc(c *cli.Context, client *etcd.Client) (*etcd.Response, error) { if len(c.Args()) == 0 { - return nil, errors.New("Key required") + return nil, errors.New("key required") } key := c.Args()[0] recursive := c.Bool("recursive") diff --git a/etcdctl/command/rmdir_command.go b/etcdctl/command/rmdir_command.go index 487c0b8c3..2b63407fb 100644 --- a/etcdctl/command/rmdir_command.go +++ b/etcdctl/command/rmdir_command.go @@ -35,7 +35,7 @@ func NewRemoveDirCommand() cli.Command { // removeDirCommandFunc executes the "rmdir" command. func removeDirCommandFunc(c *cli.Context, client *etcd.Client) (*etcd.Response, error) { if len(c.Args()) == 0 { - return nil, errors.New("Key required") + return nil, errors.New("key required") } key := c.Args()[0] diff --git a/etcdctl/command/set_command.go b/etcdctl/command/set_command.go index 365d6c4d2..118379624 100644 --- a/etcdctl/command/set_command.go +++ b/etcdctl/command/set_command.go @@ -41,12 +41,12 @@ func NewSetCommand() cli.Command { // setCommandFunc executes the "set" command. func setCommandFunc(c *cli.Context, client *etcd.Client) (*etcd.Response, error) { if len(c.Args()) == 0 { - return nil, errors.New("Key required") + return nil, errors.New("key required") } key := c.Args()[0] value, err := argOrStdin(c.Args(), os.Stdin, 1) if err != nil { - return nil, errors.New("Value required") + return nil, errors.New("value required") } ttl := c.Int("ttl") @@ -55,7 +55,6 @@ func setCommandFunc(c *cli.Context, client *etcd.Client) (*etcd.Response, error) if prevValue == "" && prevIndex == 0 { return client.Set(key, value, uint64(ttl)) - } else { - return client.CompareAndSwap(key, value, uint64(ttl), prevValue, uint64(prevIndex)) } + return client.CompareAndSwap(key, value, uint64(ttl), prevValue, uint64(prevIndex)) } diff --git a/etcdctl/command/util.go b/etcdctl/command/util.go index 7ffb80554..a9cc403ec 100644 --- a/etcdctl/command/util.go +++ b/etcdctl/command/util.go @@ -111,5 +111,4 @@ func getTransport(c *cli.Context) (*http.Transport, error) { KeyFile: keyfile, } return transport.NewTransport(tls) - }