From 13bbee426f8fe2cdd47de84e82f690dc45af899d Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sat, 19 Mar 2022 07:42:27 -0400 Subject: cvss/score.go: add MarshalJSON --- cvss/score.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cvss') 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()) +} -- cgit v1.2.3