From 8b9e4eeead8717974d34839c7b32cf9324b860db Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sat, 19 Mar 2022 07:42:10 -0400 Subject: feed: add MarshalJSON for several types --- feed/severity.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'feed/severity.go') diff --git a/feed/severity.go b/feed/severity.go index 50969ed..694b469 100644 --- a/feed/severity.go +++ b/feed/severity.go @@ -45,3 +45,8 @@ func (me *Severity) UnmarshalJSON(b []byte) error { // return success return nil } + +// Marshal CVSS severity as JSON. +func (me Severity) MarshalJSON() ([]byte, error) { + return json.Marshal(me.String()) +} -- cgit v1.2.3