1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
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) }