aboutsummaryrefslogtreecommitdiff
path: root/feed
diff options
context:
space:
mode:
Diffstat (limited to 'feed')
-rw-r--r--feed/score.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/feed/score.go b/feed/score.go
index 724e8f0..9a03c50 100644
--- a/feed/score.go
+++ b/feed/score.go
@@ -10,6 +10,17 @@ import (
// CVSS score
type Score uint8
+// // create new score from floating point value.
+// func NewScore(v float64) (Score, error) {
+// // check score
+// if v < 0.0 || v > 10.0 {
+// return Score(0), fmt.Errorf("CVSS score out of bounds: %2.1f", v)
+// } else {
+// // convert to score, return success
+// return Score(uint8(math.Trunc(10.0 * v))), nil
+// }
+// }
+
// Unmarshal CVSS score from JSON.
func (me *Score) UnmarshalJSON(b []byte) error {
// decode float, check for error