diff options
author | Paul Duncan <pabs@pablotron.org> | 2022-02-01 13:23:44 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2022-02-01 13:23:44 -0500 |
commit | a40213480929a93a78239053a40a6ee93547c063 (patch) | |
tree | b848aac63f0695b18a2f58928c7ff4d2a7eb4184 /internal/feed/feed.go | |
parent | 465f427a04c2f10bc5163f6bceef13693f7e99e6 (diff) | |
download | cvez-a40213480929a93a78239053a40a6ee93547c063.tar.bz2 cvez-a40213480929a93a78239053a40a6ee93547c063.zip |
internal/feed: add score, score tests
Diffstat (limited to 'internal/feed/feed.go')
-rw-r--r-- | internal/feed/feed.go | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/internal/feed/feed.go b/internal/feed/feed.go index 9c27fb0..b8a3849 100644 --- a/internal/feed/feed.go +++ b/internal/feed/feed.go @@ -21,27 +21,6 @@ const ( // TODO: parse cpe -// CVSS score -type Score float32 - -// Unmarshal CVSS score from JSON. -func (me *Score) UnmarshalJSON(b []byte) error { - // decode float, check for error - var v float32 - if err := json.Unmarshal(b, &v); err != nil { - return err - } - - // check score - if v < 0.0 || v > 10.0 { - return fmt.Errorf("score out of bounds: %f", v) - } - - // save result, return success - *me = Score(v) - return nil -} - // CVSS severity type Severity int |