chore(deps): update anchore dependencies (#4098)

* chore(deps): update anchore dependencies

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* address reader close operations

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Co-authored-by: wagoodman <590471+wagoodman@users.noreply.github.com>
Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
anchore-actions-token-generator[bot]
2025-07-30 17:23:07 +00:00
committed by GitHub
co-authored by wagoodman Alex Goodman
parent 8a7302c5cf
commit bd79463e77
4 changed files with 5 additions and 6 deletions
+2 -2
View File
@@ -133,6 +133,7 @@ func addLicenses(ctx context.Context, resolver file.Resolver, dbLocation file.Lo
if len(licenseStrs) == 0 {
sr, sl := fetchCopyrightContents(resolver, dbLocation, metadata)
if sr != nil && sl != nil {
defer internal.CloseAndLogError(sr, sl.AccessPath)
p.Licenses.Add(pkg.NewLicensesFromReadCloserWithContext(ctx, file.NewLocationReadCloser(*sl, sr))...)
}
}
@@ -292,11 +293,10 @@ func fetchCopyrightContents(resolver file.Resolver, dbLocation file.Location, m
return nil, nil
}
reader, err := resolver.FileContentsByLocation(*location)
reader, err := resolver.FileContentsByLocation(*location) //nolint:gocritic // since we're returning the reader, it's up to the caller to close it
if err != nil {
log.Tracef("failed to fetch deb copyright contents (package=%s): %s", m.Package, err)
}
defer internal.CloseAndLogError(reader, location.RealPath)
l := location.WithAnnotation(pkg.EvidenceAnnotationKey, pkg.SupportingEvidenceAnnotation)
-1
View File
@@ -98,7 +98,6 @@ func findLibmanJSON(resolver file.Resolver, depsJSON file.Location) (*libmanJSON
if err != nil {
return nil, err
}
internal.CloseAndLogError(reader, loc.RealPath)
lj, err := newLibmanJSON(file.NewLocationReadCloser(*loc, reader))
if err != nil {