Browse Source

Merge pull request #10443 from Quasilyte/quasilyte/fix_args_order

etcdctl: fix strings.HasPrefix args order
Xiang Li 6 years ago
parent
commit
1fe6f109c8
2 changed files with 2 additions and 2 deletions
  1. 1 1
      etcdctl/ctlv2/command/util.go
  2. 1 1
      etcdctl/ctlv3/command/global.go

+ 1 - 1
etcdctl/ctlv2/command/util.go

@@ -104,7 +104,7 @@ func getDomainDiscoveryFlagValue(c *cli.Context) ([]string, error) {
 	// strip insecure connections
 	ret := []string{}
 	for _, ep := range eps {
-		if strings.HasPrefix("http://", ep) {
+		if strings.HasPrefix(ep, "http://") {
 			fmt.Fprintf(os.Stderr, "ignoring discovered insecure endpoint %q\n", ep)
 			continue
 		}

+ 1 - 1
etcdctl/ctlv3/command/global.go

@@ -444,7 +444,7 @@ func endpointsFromFlagValue(cmd *cobra.Command) ([]string, error) {
 	// strip insecure connections
 	ret := []string{}
 	for _, ep := range eps {
-		if strings.HasPrefix("http://", ep) {
+		if strings.HasPrefix(ep, "http://") {
 			fmt.Fprintf(os.Stderr, "ignoring discovered insecure endpoint %q\n", ep)
 			continue
 		}