From 07390eeb960df3ca10b758c9f62459cf2ee9aa3f Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 1 Feb 2022 01:21:45 -0500 Subject: add internal/feed/dataformat.go --- internal/feed/feed.go | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'internal/feed/feed.go') diff --git a/internal/feed/feed.go b/internal/feed/feed.go index b4d514b..a43b7e9 100644 --- a/internal/feed/feed.go +++ b/internal/feed/feed.go @@ -9,8 +9,7 @@ import ( ) const ( - MitreFormat = iota // MITRE data format - DataVersion40 // Version 4.0 + DataVersion40 = iota // Version 4.0 OrNodeOp // OR operator AndNodeOp // And operator @@ -43,30 +42,6 @@ const ( // TODO: parse cpe -// Data format for NVD feeds and feed items. -type DataFormat int - -// Unmarshal DataFormat from JSON. -func (me *DataFormat) UnmarshalJSON(b []byte) error { - // decode string, check for error - var s string - if err := json.Unmarshal(b, &s); err != nil { - return err - } - - // check value - switch s { - case "MITRE": - *me = MitreFormat - default: - // return error - return fmt.Errorf("unknown data format: %s", s) - } - - // return success - return nil -} - // Data version for NVD feeds and feed items. type DataVersion int -- cgit v1.2.3