diff options
Diffstat (limited to 'feed/cveid.go')
-rw-r--r-- | feed/cveid.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/feed/cveid.go b/feed/cveid.go index 5e43ad3..d7d9a32 100644 --- a/feed/cveid.go +++ b/feed/cveid.go @@ -75,6 +75,11 @@ func NewCveId(s string) (CveId, error) { return CveId(encodeCveId(year, num)), nil } +// Marshal CVE ID to JSON. +func (me CveId) MarshalJSON() ([]byte, error) { + return json.Marshal(me.String()) +} + // Unmarshal CVE ID from JSON. func (me *CveId) UnmarshalJSON(b []byte) error { // decode string, check for error |