diff --git a/app/vmctl/influx/parser.go b/app/vmctl/influx/parser.go
index 5cd5a374c3..a4b7ab7d6a 100644
--- a/app/vmctl/influx/parser.go
+++ b/app/vmctl/influx/parser.go
@@ -61,9 +61,8 @@ func toFloat64(v interface{}) (float64, error) {
 	case bool:
 		if i {
 			return 1, nil
-		} else {
-			return 0, nil
 		}
+		return 0, nil
 	default:
 		return 0, fmt.Errorf("unexpected value type %v", i)
 	}
diff --git a/app/vmctl/influx/parser_test.go b/app/vmctl/influx/parser_test.go
index 15ce9adaa5..70ee424bba 100644
--- a/app/vmctl/influx/parser_test.go
+++ b/app/vmctl/influx/parser_test.go
@@ -1,6 +1,7 @@
 package influx
 
 import (
+	"encoding/json"
 	"reflect"
 	"testing"
 )
@@ -58,3 +59,28 @@ func TestSeries_Unmarshal(t *testing.T) {
 		}
 	}
 }
+
+func TestToFloat64(t *testing.T) {
+	f := func(in interface{}, want float64) {
+		t.Helper()
+		got, err := toFloat64(in)
+		if err != nil {
+			t.Fatalf("unexpected err: %s", err)
+		}
+		if got != want {
+			t.Errorf("got %v; want %v", got, want)
+		}
+	}
+	f("123.4", 123.4)
+	f(float64(123.4), 123.4)
+	f(float32(12), 12)
+	f(123, 123)
+	f(true, 1)
+	f(false, 0)
+	f(json.Number("123456.789"), 123456.789)
+
+	_, err := toFloat64("text")
+	if err == nil {
+		t.Fatalf("expected to get err; got nil instead")
+	}
+}