Use Go style conventions for variable name

This commit is contained in:
Daniel Nelson 2019-07-24 14:04:33 -07:00
parent 417740738d
commit 4f115437e6
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 3 additions and 3 deletions

View File

@ -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
}