diff options
author | Paul Duncan <pabs@pablotron.org> | 2022-01-31 23:28:22 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2022-01-31 23:28:22 -0500 |
commit | 94b148ccdcb88f2544c222f73f5c734ac78ccd96 (patch) | |
tree | 23cfa33a5df29cdfb269f5f517217ff457f314fa /internal/cvss/v3metric.go | |
parent | 5c4ff27a0bc70cdefad0c9a68e920e480465c4d9 (diff) | |
download | cvez-94b148ccdcb88f2544c222f73f5c734ac78ccd96.tar.bz2 cvez-94b148ccdcb88f2544c222f73f5c734ac78ccd96.zip |
internal/cvss: more tests
Diffstat (limited to 'internal/cvss/v3metric.go')
-rw-r--r-- | internal/cvss/v3metric.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/internal/cvss/v3metric.go b/internal/cvss/v3metric.go index e9a6763..fc4c860 100644 --- a/internal/cvss/v3metric.go +++ b/internal/cvss/v3metric.go @@ -323,12 +323,9 @@ func (m v3Metric) Key() Key { // Convert string to CVSS 3.1 metric. func getV3Metric(version Version, s string) (v3Metric, error) { - // get metric - m, ok := v3MetricStrLut[s] - if !ok { + if m, ok := v3MetricStrLut[s]; ok { + return m, nil + } else { return v3InvalidMetric, newBadMetric(version, s) } - - // return success - return m, nil } |