From bd2e16a48654534151f79f43af36b42e6b2dcd6b Mon Sep 17 00:00:00 2001 From: Huamin Chen Date: Wed, 15 Nov 2023 10:44:06 -0500 Subject: [PATCH] fix lint Signed-off-by: Huamin Chen --- pkg/model/types/types.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/model/types/types.go b/pkg/model/types/types.go index 0964e43a42..001cd09ff7 100644 --- a/pkg/model/types/types.go +++ b/pkg/model/types/types.go @@ -20,6 +20,9 @@ type ModelType int type ModelOutputType int type RegressorType int +// fix golint (goconst) +const UNKNOWN_TYPE = "unknown" + var ( ModelOutputTypeConverter = []string{ "AbsPower", "DynPower", @@ -64,21 +67,21 @@ func (s ModelOutputType) String() string { if s > 0 && int(s) <= len(ModelOutputTypeConverter) { return ModelOutputTypeConverter[s-1] } - return "unknown" + return UNKNOWN_TYPE } func (s ModelType) String() string { if s > 0 && int(s) <= len(ModelTypeConverter) { return ModelTypeConverter[s-1] } - return "unknown" + return UNKNOWN_TYPE } func (r RegressorType) String() string { if r > 0 && int(r) <= len(RegressorTypeConverter) { return RegressorTypeConverter[r-1] } - return "unknown" + return UNKNOWN_TYPE } type ModelConfig struct {