Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Support whole number float64 type for severity parsing #90

Merged
merged 1 commit into from
Apr 6, 2021

Conversation

jsirianni
Copy link
Member

Severity parsing should support float64 values when they are whole numbers. Golang JSON parsing will consider any number a float64 unless it is unmarshalled to a struct using specific types (int, int64, float64, etc).

Trying to parse the pri field as a Severity will result in an "unsupported type float64" error.

{
  "uid": 62,
  "time": 1617410898,
  "pri": 6,
  "tag": "pve-ha-lrm",
  "pid": 33690,
  "node": "pve-1",
  "user": "root@pam",
  "msg": "end task UPID:pve-1:0000839B:000C5C3F:6067BB15:qmshutdown:100:root@pam: OK"
}

Additional context:

@jsirianni jsirianni requested a review from djaglowski April 5, 2021 23:21
Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jsirianni jsirianni merged commit e63fbfe into main Apr 6, 2021
@jsirianni jsirianni deleted the severity-float64 branch April 6, 2021 15:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants