From 5dbf57134000f5ff2c5c12342ac4439b6d395603 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 1 Feb 2022 07:56:12 -0500 Subject: internal/feed: add nodeop tests --- internal/feed/feed.go | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'internal/feed/feed.go') diff --git a/internal/feed/feed.go b/internal/feed/feed.go index cf0fd2d..93a4a8f 100644 --- a/internal/feed/feed.go +++ b/internal/feed/feed.go @@ -7,10 +7,7 @@ import ( ) const ( - OrNodeOp = iota // OR operator - AndNodeOp // And operator - - AdjacentNetwork // Adjacent Network attack vector. + AdjacentNetwork = iota // Adjacent Network attack vector. Network // Network attack vector. Local // Local attack vector. Physical // Physical attack vector. @@ -38,32 +35,6 @@ const ( // TODO: parse cpe -// Configuration node boolean operator. -type NodeOp int - -// Unmarshal DataVersion from JSON. -func (me *NodeOp) 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 "AND": - *me = AndNodeOp - case "OR": - *me = OrNodeOp - default: - // return error - return fmt.Errorf("unknown operator: %s", s) - } - - // return success - return nil -} - // CVSS attack vector type AttackVector int -- cgit v1.2.3