Skip to content

Commit

Permalink
apply feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoCaso committed Jan 5, 2024
1 parent a344c15 commit ff32f9e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions comp/core/status/render_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ func lastErrorMessage(value string) string {
// formatUnixTime formats the unix time to make it more readable
func formatUnixTime(unixTime any) string {
// Initially treat given unixTime is in nanoseconds

parseFunction := func(value int64) string {
t := time.Unix(0, value)
// If year returned 1970, assume unixTime actually in seconds
Expand All @@ -154,7 +153,7 @@ func formatUnixTime(unixTime any) string {
case float64:
return parseFunction(int64(v))
default:
return ""
return fmt.Sprintf("Invalid time parameter %T", v)
}
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/cli/subcommands/check/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,19 +450,18 @@ func run(
checkRuns := collectorData["runnerStats"].(map[string]interface{})["Checks"].(map[string]interface{})
for _, c := range cs {
s := runCheck(cliParams, c, printer)
var checkResult map[string]interface{}
resultBytes, err := json.Marshal(s)
if err != nil {
return err
}

var checkResult map[string]interface{}
err = json.Unmarshal(resultBytes, &checkResult)
if err != nil {
return err
}

checkMap := make(map[string]interface{})

checkMap[string(c.ID())] = checkResult
checkRuns[c.String()] = checkMap

Expand Down
2 changes: 1 addition & 1 deletion pkg/status/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func PopulateStatus(stats map[string]interface{}) {
stats["inventories"] = checkMetadata
}

// Provider provides the functionality to populate the status output with the collectro information
// Provider provides the functionality to populate the status output with the collector information
type Provider struct{}

// Name returns the name
Expand Down

0 comments on commit ff32f9e

Please sign in to comment.