aboutsummaryrefslogtreecommitdiff
path: root/cvss
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2022-03-19 07:42:27 -0400
committerPaul Duncan <pabs@pablotron.org>2022-03-19 07:42:27 -0400
commit13bbee426f8fe2cdd47de84e82f690dc45af899d (patch)
tree3cc13cae10457b9a6c5c21dac2fdbd83d2b75e83 /cvss
parent8b9e4eeead8717974d34839c7b32cf9324b860db (diff)
downloadcvez-13bbee426f8fe2cdd47de84e82f690dc45af899d.tar.bz2
cvez-13bbee426f8fe2cdd47de84e82f690dc45af899d.zip
cvss/score.go: add MarshalJSON
Diffstat (limited to 'cvss')
-rw-r--r--cvss/score.go6
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())
+}