Add Matches() to pkg.Package

This commit is contained in:
Ettore Di Giacinto
2019-11-15 18:04:46 +01:00
parent 891daf4b71
commit 83fb1d1219
5 changed files with 19 additions and 11 deletions

View File

@@ -160,7 +160,7 @@ func (db *InMemoryDatabase) FindPackage(p Package) (Package, error) {
if err != nil {
return nil, err
}
if pack.GetFingerPrint() == p.GetFingerPrint() {
if pack.Matches(p) {
return pack, nil
}
}
@@ -175,7 +175,7 @@ func (db *InMemoryDatabase) UpdatePackage(p Package) error {
if err != nil {
return err
}
if pack.GetFingerPrint() == p.GetFingerPrint() {
if pack.Matches(p) {
id = k
found = true
break