Refactoring packages
Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
This commit is contained in:
parent
58cdb88537
commit
0786b2c060
@ -20,10 +20,10 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/coreos/pkg/capnslog"
|
|
||||||
"github.com/coreos/clair/database"
|
"github.com/coreos/clair/database"
|
||||||
"github.com/coreos/clair/utils/types"
|
"github.com/coreos/clair/utils/types"
|
||||||
"github.com/coreos/clair/worker/detectors"
|
"github.com/coreos/clair/worker/detectors"
|
||||||
|
"github.com/coreos/pkg/capnslog"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -100,13 +100,7 @@ func (detector *DpkgPackagesDetector) Detect(data map[string][]byte) ([]*databas
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the map to a slice
|
return mapToSlices(packagesMap), nil
|
||||||
packages := make([]*database.Package, 0, len(packagesMap))
|
|
||||||
for _, pkg := range packagesMap {
|
|
||||||
packages = append(packages, pkg)
|
|
||||||
}
|
|
||||||
|
|
||||||
return packages, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRequiredFiles returns the list of files required for Detect, without
|
// GetRequiredFiles returns the list of files required for Detect, without
|
||||||
|
@ -21,8 +21,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/coreos/clair/database"
|
"github.com/coreos/clair/database"
|
||||||
cerrors "github.com/coreos/clair/utils/errors"
|
|
||||||
"github.com/coreos/clair/utils"
|
"github.com/coreos/clair/utils"
|
||||||
|
cerrors "github.com/coreos/clair/utils/errors"
|
||||||
"github.com/coreos/clair/utils/types"
|
"github.com/coreos/clair/utils/types"
|
||||||
"github.com/coreos/clair/worker/detectors"
|
"github.com/coreos/clair/worker/detectors"
|
||||||
)
|
)
|
||||||
@ -96,13 +96,7 @@ func (detector *RpmPackagesDetector) Detect(data map[string][]byte) ([]*database
|
|||||||
packagesMap[pkg.Key()] = pkg
|
packagesMap[pkg.Key()] = pkg
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the map to a slice
|
return mapToSlices(packagesMap), nil
|
||||||
packages := make([]*database.Package, 0, len(packagesMap))
|
|
||||||
for _, pkg := range packagesMap {
|
|
||||||
packages = append(packages, pkg)
|
|
||||||
}
|
|
||||||
|
|
||||||
return packages, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRequiredFiles returns the list of files required for Detect, without
|
// GetRequiredFiles returns the list of files required for Detect, without
|
||||||
|
Loading…
Reference in New Issue
Block a user