diff --git a/pkg/fanal/applier/docker.go b/pkg/fanal/applier/docker.go index 44a64b669be4..36592a4e5ba6 100644 --- a/pkg/fanal/applier/docker.go +++ b/pkg/fanal/applier/docker.go @@ -120,17 +120,17 @@ func ApplyLayers(layers []types.BlobInfo) types.ArtifactDetail { return pkg.ID }) - newPackages := make(types.Packages, 0) + updatedPackages := make(types.Packages, 0) lo.ForEach(pkgInfo.Packages, func(pkg types.Package, _ int) { if mPkg, ok := mapPkgs[pkg.ID]; ok { pkg.InstalledFiles = lo.Uniq(append(pkg.InstalledFiles, mPkg.InstalledFiles...)) } - newPackages = append(newPackages, pkg) + updatedPackages = append(updatedPackages, pkg) }) nestedMap.SetByString(key, sep, types.PackageInfo{ FilePath: pkgInfo.FilePath, - Packages: newPackages, + Packages: updatedPackages, }) } }