aboutsummaryrefslogtreecommitdiff
path: root/internal/cvss/badkey.go
blob: 872a6d26b39912d0c6532d31b3961bd7196b61ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// CVSS vector parser.
package cvss

import "fmt"

// Bad metric key error.
type badKey struct {
  version Version
  key string
}

// Create new bad key error.
func newBadKey(version Version, key string) error {
  return &badKey { version, key }
}

// Return printable error string
func (e badKey) Error() string {
  return fmt.Sprintf("invalid CVSS %s metric key: %s", e.version, e.key)
}