Jelajahi Sumber

etcdctl: fix strings.HasPrefix args order

Signed-off-by: Iskander Sharipov <quasilyte@gmail.com>
Iskander Sharipov 6 tahun lalu
induk
melakukan
e634184dc6
2 mengubah file dengan 2 tambahan dan 2 penghapusan
  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
 	// strip insecure connections
 	ret := []string{}
 	ret := []string{}
 	for _, ep := range eps {
 	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)
 			fmt.Fprintf(os.Stderr, "ignoring discovered insecure endpoint %q\n", ep)
 			continue
 			continue
 		}
 		}

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

@@ -402,7 +402,7 @@ func endpointsFromFlagValue(cmd *cobra.Command) ([]string, error) {
 	// strip insecure connections
 	// strip insecure connections
 	ret := []string{}
 	ret := []string{}
 	for _, ep := range eps {
 	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)
 			fmt.Fprintf(os.Stderr, "ignoring discovered insecure endpoint %q\n", ep)
 			continue
 			continue
 		}
 		}