Browse Source

etcdctl/ctlv3: fix "unconvert" warnings

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Gyuho Lee 7 years ago
parent
commit
b44e43278a
1 changed files with 3 additions and 3 deletions
  1. 3 3
      etcdctl/ctlv3/command/check.go

+ 3 - 3
etcdctl/ctlv3/command/check.go

@@ -192,7 +192,7 @@ func newCheckPerfCommand(cmd *cobra.Command, args []string) {
 		cctx, ccancel := context.WithTimeout(context.Background(), time.Duration(cfg.duration)*time.Second)
 		cctx, ccancel := context.WithTimeout(context.Background(), time.Duration(cfg.duration)*time.Second)
 		defer ccancel()
 		defer ccancel()
 		for limit.Wait(cctx) == nil {
 		for limit.Wait(cctx) == nil {
-			binary.PutVarint(k, int64(rand.Int63n(math.MaxInt64)))
+			binary.PutVarint(k, rand.Int63n(math.MaxInt64))
 			requests <- v3.OpPut(checkPerfPrefix+string(k), v)
 			requests <- v3.OpPut(checkPerfPrefix+string(k), v)
 		}
 		}
 		close(requests)
 		close(requests)
@@ -349,7 +349,7 @@ func newCheckDatascaleCommand(cmd *cobra.Command, args []string) {
 
 
 	go func() {
 	go func() {
 		for i := 0; i < cfg.limit; i++ {
 		for i := 0; i < cfg.limit; i++ {
-			binary.PutVarint(k, int64(rand.Int63n(math.MaxInt64)))
+			binary.PutVarint(k, rand.Int63n(math.MaxInt64))
 			requests <- v3.OpPut(checkDatascalePrefix+string(k), v)
 			requests <- v3.OpPut(checkDatascalePrefix+string(k), v)
 		}
 		}
 		close(requests)
 		close(requests)
@@ -400,6 +400,6 @@ func newCheckDatascaleCommand(cmd *cobra.Command, args []string) {
 		}
 		}
 		os.Exit(ExitError)
 		os.Exit(ExitError)
 	} else {
 	} else {
-		fmt.Println(fmt.Sprintf("PASS: Approximate system memory used : %v MB.", strconv.FormatFloat(float64(mbUsed), 'f', 2, 64)))
+		fmt.Println(fmt.Sprintf("PASS: Approximate system memory used : %v MB.", strconv.FormatFloat(mbUsed, 'f', 2, 64)))
 	}
 	}
 }
 }