From 31929b83d50e841499676309168f93a8e6b42bd6 Mon Sep 17 00:00:00 2001 From: johncming Date: Sun, 2 Aug 2020 16:57:38 +0800 Subject: [PATCH] promql: use explicit type declare instead of string. (#7716) Signed-off-by: johncming --- promql/parser/value.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/promql/parser/value.go b/promql/parser/value.go index c065e93af..f882f9f0b 100644 --- a/promql/parser/value.go +++ b/promql/parser/value.go @@ -24,20 +24,20 @@ type ValueType string // The valid value types. const ( - ValueTypeNone = "none" - ValueTypeVector = "vector" - ValueTypeScalar = "scalar" - ValueTypeMatrix = "matrix" - ValueTypeString = "string" + ValueTypeNone ValueType = "none" + ValueTypeVector ValueType = "vector" + ValueTypeScalar ValueType = "scalar" + ValueTypeMatrix ValueType = "matrix" + ValueTypeString ValueType = "string" ) // DocumentedType returns the internal type to the equivalent // user facing terminology as defined in the documentation. func DocumentedType(t ValueType) string { switch t { - case "vector": + case ValueTypeVector: return "instant vector" - case "matrix": + case ValueTypeMatrix: return "range vector" default: return string(t)