func (m *Matcher) Vulnerable(ctx context.Context, record *claircore.IndexRecord, vuln *claircore.Vulnerability) (bool, error) {
	pkgVer, vulnVer := version.NewVersion(record.Package.Version), version.NewVersion(vuln.Package.Version)
	// Assume the vulnerability record we have is for the last known vulnerable
	// version, so greater versions aren't vulnerable.
	cmp := func(i int) bool { return i != version.GREATER }
	// But if it's explicitly marked as a fixed-in version, it's only vulnerable
	// if less than that version.
	if vuln.FixedInVersion != "" {
		vulnVer = version.NewVersion(vuln.FixedInVersion)
		cmp = func(i int) bool { return i == version.LESS }
	}
	// compare version and architecture
	return cmp(pkgVer.Compare(vulnVer)) && vuln.ArchOperation.Cmp(record.Package.Arch, vuln.Package.Arch), nil
}
// Vulnerable implements driver.Matcher.
Vulnerable implements driver.Matcher.
// Vulnerable implements driver . Matcher .
func (m *Matcher) Vulnerable(ctx context.Context, record *claircore.IndexRecord, vuln *claircore.Vulnerability) (bool, error) {
	pkgVer, vulnVer := version.NewVersion(record.Package.Version), version.NewVersion(vuln.Package.Version)
	cmp := func(i int) bool { return i != version.GREATER }
	if vuln.FixedInVersion != "" {
		vulnVer = version.NewVersion(vuln.FixedInVersion)
		cmp = func(i int) bool { return i == version.LESS }
	}
	return cmp(pkgVer.Compare(vulnVer)) && vuln.ArchOperation.Cmp(record.Package.Arch, vuln.Package.Arch), nil
}
func ( m * Matcher ) Vulnerable ( ctx context . Context , record * claircore . IndexRecord , vuln * claircore . Vulnerability ) ( bool , error ) { pkgVer , vulnVer := version . NewVersion ( record . Package . Version ) , version . NewVersion ( vuln . Package . Version ) cmp := func ( i int ) bool { return i != version . GREATER } if vuln . FixedInVersion != " " { vulnVer = version . NewVersion ( vuln . FixedInVersion ) cmp = func ( i int ) bool { return i == version . LESS } } return cmp ( pkgVer . Compare ( vulnVer ) ) && vuln . ArchOperation . Cmp ( record . Package . Arch , vuln . Package . Arch ) , nil }
Vulnerable implements driver.Matcher.
Vulnerable implements driver . Matcher .
// Assume the vulnerability record we have is for the last known vulnerable // version, so greater versions aren't vulnerable. // But if it's explicitly marked as a fixed-in version, it's only vulnerable // if less than that version. // compare version and architecture