Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Martin <chris@cmartinit.co.uk>
  • Loading branch information
d80tb7 committed Jun 5, 2024
1 parent f130915 commit 4a155df
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions internal/lookoutv2/repository/fieldparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type FieldParser interface {
}

type LastTransitionTimeParser struct {
variable pgtype.Numeric
variable pgtype.Float8
}

func (fp *LastTransitionTimeParser) GetField() string {
Expand All @@ -31,12 +31,7 @@ func (fp *LastTransitionTimeParser) GetVariableRef() interface{} {
}

func (fp *LastTransitionTimeParser) ParseValue() (interface{}, error) {
var dst float64
err := fp.variable.Scan(&dst)
if err != nil {
return "", err
}
t := time.Unix(int64(math.Round(dst)), 0)
t := time.Unix(int64(math.Round(fp.variable.Float64)), 0)
return t.Format(time.RFC3339), nil
}

Expand Down

0 comments on commit 4a155df

Please sign in to comment.