From 48a2442fd75899b44b935360c602cc849ca2fff6 Mon Sep 17 00:00:00 2001 From: Iskander Sharipov Date: Sat, 2 Feb 2019 02:39:27 +0300 Subject: [PATCH] etcdctl: fix strings.HasPrefix args order Signed-off-by: Iskander Sharipov --- etcdctl/ctlv2/command/util.go | 2 +- etcdctl/ctlv3/command/global.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/etcdctl/ctlv2/command/util.go b/etcdctl/ctlv2/command/util.go index d19cd40e384..c178abd9da2 100644 --- a/etcdctl/ctlv2/command/util.go +++ b/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 } diff --git a/etcdctl/ctlv3/command/global.go b/etcdctl/ctlv3/command/global.go index eb90f2a4fac..49a22037983 100644 --- a/etcdctl/ctlv3/command/global.go +++ b/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 }