aboutsummaryrefslogtreecommitdiff
path: root/cvss
diff options
context:
space:
mode:
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())
+}