Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Huamin Chen <[email protected]>
  • Loading branch information
rootfs committed Nov 15, 2023
1 parent ebb9051 commit bd2e16a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/model/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit bd2e16a

Please sign in to comment.