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 }