From f2cef211cda0d86ccd42e8aa411f9865a2a22cce Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Mon, 7 Feb 2022 11:07:39 -0500 Subject: cvss: rename v2Score to Score, update deps and tests --- cvss/v2score.go | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 cvss/v2score.go (limited to 'cvss/v2score.go') diff --git a/cvss/v2score.go b/cvss/v2score.go deleted file mode 100644 index 5740c09..0000000 --- a/cvss/v2score.go +++ /dev/null @@ -1,32 +0,0 @@ -package cvss - -import ( - "fmt" -) - -// Individual CVSS v2 score. -// -// Note: since scores range from 0.0 to 10.0 with one decimal place of -// precision, they can be safely represented as a uint8. -type v2Score uint8 - -// Return floating point representation of score. -func newV2Score(val float64) (v2Score, error) { - // check score range - if val < 0.0 || val > 10.0 { - return v2Score(0), fmt.Errorf("score value out of range [0, 10]: %f", val) - } - - // convert to score, return success - return v2Score(uint8(10.0 * val)), nil -} - -// Return string representation of score. -func (s v2Score) String() string { - return fmt.Sprintf("%d.%d", s / 10, s % 10) -} - -// Return floating point representation of score. -func (s v2Score) Float() float32 { - return float32(s) / 10.0 -} -- cgit v1.2.3