diff options
Diffstat (limited to 'internal/cvss/badkey.go')
-rw-r--r-- | internal/cvss/badkey.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/cvss/badkey.go b/internal/cvss/badkey.go new file mode 100644 index 0000000..872a6d2 --- /dev/null +++ b/internal/cvss/badkey.go @@ -0,0 +1,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) +} |