diff options
author | Paul Duncan <pabs@pablotron.org> | 2022-03-19 07:42:27 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2022-03-19 07:42:27 -0400 |
commit | 13bbee426f8fe2cdd47de84e82f690dc45af899d (patch) | |
tree | 3cc13cae10457b9a6c5c21dac2fdbd83d2b75e83 | |
parent | 8b9e4eeead8717974d34839c7b32cf9324b860db (diff) | |
download | cvez-13bbee426f8fe2cdd47de84e82f690dc45af899d.tar.bz2 cvez-13bbee426f8fe2cdd47de84e82f690dc45af899d.zip |
cvss/score.go: add MarshalJSON
-rw-r--r-- | cvss/score.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cvss/score.go b/cvss/score.go index 94a15a5..d167af1 100644 --- a/cvss/score.go +++ b/cvss/score.go @@ -1,6 +1,7 @@ package cvss import ( + "encoding/json" "fmt" ) @@ -60,3 +61,8 @@ func (s Score) Severity() Severity { // return unknown severity return Unknown } + +// Marshal score as JSON. +func (s Score) MarshalJSON() ([]byte, error) { + return json.Marshal(s.Float()) +} |