From 4f115437e6a1ea8d25e65d6e2d205ae927133414 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Wed, 24 Jul 2019 14:04:33 -0700 Subject: [PATCH] Use Go style conventions for variable name --- plugins/inputs/redis/redis.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/inputs/redis/redis.go b/plugins/inputs/redis/redis.go index 40f059ce8..d17e7a845 100644 --- a/plugins/inputs/redis/redis.go +++ b/plugins/inputs/redis/redis.go @@ -254,10 +254,10 @@ func gatherInfoOutput( val := strings.TrimSpace(parts[1]) // Some percentage values have a "%" suffix that we need to get rid of before int/float conversion - num_val := strings.TrimSuffix(val, "%") + val = strings.TrimSuffix(val, "%") // Try parsing as int - if ival, err := strconv.ParseInt(num_val, 10, 64); err == nil { + if ival, err := strconv.ParseInt(val, 10, 64); err == nil { switch name { case "keyspace_hits": keyspace_hits = ival @@ -272,7 +272,7 @@ func gatherInfoOutput( } // Try parsing as a float - if fval, err := strconv.ParseFloat(num_val, 64); err == nil { + if fval, err := strconv.ParseFloat(val, 64); err == nil { fields[metric] = fval continue }