Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen committed Sep 3, 2024
1 parent 6e604a5 commit 75619ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/fanal/analyzer/language/python/packaging/egg.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ func (a eggAnalyzer) fillLicensesFromFile(r xio.ReadSeekerAt, size int64, app *t
required := func(filePath string) bool {
return path.Base(filePath) == path.Base(strings.TrimPrefix(license, "file://"))
}
lr, err := a.findFileInZip(r, size, required)
f, err := a.findFileInZip(r, size, required)
if err != nil {
a.logger.Debug("unable to find license file in `*.egg` file", log.Err(err))
continue
} else if lr == nil { // zip doesn't contain license file
} else if f == nil { // zip doesn't contain license file
continue
}

l, err := licensing.Classify("", lr, a.licenseClassifierConfidenceLevel)
l, err := licensing.Classify("", f, a.licenseClassifierConfidenceLevel)
if err != nil {
return xerrors.Errorf("license classify error: %w", err)
} else if l == nil {
Expand Down

0 comments on commit 75619ac

Please sign in to comment.