Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
This commit is contained in:
Nicolas Lamirault 2016-01-12 22:27:38 +01:00
parent b059b0d6dd
commit ce185ebe33
4 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
// Copyright 2015 clair authors // Copyright 2015, 2016 clair authors
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -18,7 +18,7 @@ import (
"github.com/coreos/clair/database" "github.com/coreos/clair/database"
) )
func mapToSlices(packagesMap map[string]*database.Package) []*database.Package { func mapToSlice(packagesMap map[string]*database.Package) []*database.Package {
packages := make([]*database.Package, 0, len(packagesMap)) packages := make([]*database.Package, 0, len(packagesMap))
for _, pkg := range packagesMap { for _, pkg := range packagesMap {
packages = append(packages, pkg) packages = append(packages, pkg)

View File

@ -1,4 +1,4 @@
// Copyright 2015 clair authors // Copyright 2015, 2016 clair authors
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -100,7 +100,7 @@ func (detector *DpkgPackagesDetector) Detect(data map[string][]byte) ([]*databas
} }
} }
return mapToSlices(packagesMap), nil return mapToSlice(packagesMap), nil
} }
// GetRequiredFiles returns the list of files required for Detect, without // GetRequiredFiles returns the list of files required for Detect, without

View File

@ -67,7 +67,7 @@ func (detector *PacmanPackagesDetector) Detect(data map[string][]byte) ([]*datab
} }
packagesMap[pkg.Key()] = pkg packagesMap[pkg.Key()] = pkg
} }
return mapToSlices(packagesMap), nil return mapToSlice(packagesMap), nil
} }
// GetRequiredFiles returns the list of files required for Detect, without // GetRequiredFiles returns the list of files required for Detect, without

View File

@ -1,4 +1,4 @@
// Copyright 2015 clair authors // Copyright 2015, 2016 clair authors
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -96,7 +96,7 @@ func (detector *RpmPackagesDetector) Detect(data map[string][]byte) ([]*database
packagesMap[pkg.Key()] = pkg packagesMap[pkg.Key()] = pkg
} }
return mapToSlices(packagesMap), nil return mapToSlice(packagesMap), nil
} }
// GetRequiredFiles returns the list of files required for Detect, without // GetRequiredFiles returns the list of files required for Detect, without