Browse Source

tools: Fix shadow variables and incorrect printing format.

ngaut 10 years ago
parent
commit
232439191c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      tools/etcd-top/etcd-top.go

+ 2 - 2
tools/etcd-top/etcd-top.go

@@ -166,9 +166,9 @@ func main() {
 
 	ports := []uint16{}
 	for _, p := range strings.Split(*portsArg, ",") {
-		p, err := strconv.Atoi(p)
+		port, err := strconv.Atoi(p)
 		if err == nil {
-			ports = append(ports, uint16(p))
+			ports = append(ports, uint16(port))
 		} else {
 			fmt.Fprintf(os.Stderr, "Failed to parse port \"%s\": %v\n", p, err)
 			os.Exit(1)