ctlv3: fix gofmt

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
release-3.4
Gyuho Lee 2018-09-28 09:53:24 -07:00
parent a3e242d80a
commit 1a8c520979
1 changed files with 9 additions and 8 deletions

View File

@ -15,6 +15,7 @@
package command package command
import ( import (
"errors"
"fmt" "fmt"
"strconv" "strconv"
"strings" "strings"
@ -97,21 +98,21 @@ The items in the lists are ID, Status, Name, Peer Addrs, Client Addrs.
// memberAddCommandFunc executes the "member add" command. // memberAddCommandFunc executes the "member add" command.
func memberAddCommandFunc(cmd *cobra.Command, args []string) { func memberAddCommandFunc(cmd *cobra.Command, args []string) {
if len(args) < 1 { if len(args) < 1 {
ExitWithError(ExitBadArgs, fmt.Errorf("member name not provided.")) ExitWithError(ExitBadArgs, errors.New("member name not provided"))
} }
if len(args) > 1 { if len(args) > 1 {
errorstring := "too many arguments" ev := "too many arguments"
for _, v := range args { for _, s := range args {
if strings.HasPrefix(strings.ToLower(v), "http"){ if strings.HasPrefix(strings.ToLower(s), "http") {
errorstring += ", did you mean \"--peer-urls " + v + "\"" ev += fmt.Sprintf(`, did you mean --peer-urls=%s`, s)
} }
} }
ExitWithError(ExitBadArgs, fmt.Errorf(errorstring)) ExitWithError(ExitBadArgs, errors.New(ev))
} }
newMemberName := args[0] newMemberName := args[0]
if len(memberPeerURLs) == 0 { if len(memberPeerURLs) == 0 {
ExitWithError(ExitBadArgs, fmt.Errorf("member peer urls not provided.")) ExitWithError(ExitBadArgs, errors.New("member peer urls not provided"))
} }
urls := strings.Split(memberPeerURLs, ",") urls := strings.Split(memberPeerURLs, ",")
@ -198,7 +199,7 @@ func memberUpdateCommandFunc(cmd *cobra.Command, args []string) {
} }
if len(memberPeerURLs) == 0 { if len(memberPeerURLs) == 0 {
ExitWithError(ExitBadArgs, fmt.Errorf("member peer urls not provided.")) ExitWithError(ExitBadArgs, fmt.Errorf("member peer urls not provided"))
} }
urls := strings.Split(memberPeerURLs, ",") urls := strings.Split(memberPeerURLs, ",")