mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 15:06:36 +01:00
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:
co-authored by
wagoodman
Alex Goodman
parent
8a7302c5cf
commit
bd79463e77
@@ -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)
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user