Skip to content

Commit

Permalink
refactor(analyzer): remove unneeded comment
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen committed Jul 1, 2024
1 parent 9200c44 commit 61e9c7e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/fanal/analyzer/language/conda/environment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,14 @@ func (*parser) Parse(r xio.ReadSeekerAt) ([]types.Package, []types.Dependency, e
}

once := sync.Once{}
// res always contains only 1 Application
// cf. https://github.com/aquasecurity/trivy/blob/0ccdbfbb6598a52de7cda603ab22e794f710e86c/pkg/fanal/analyzer/language/analyze.go#L32
for i, pkg := range pkgs.Packages {
// Skip packages without a version, because in this case we will not be able to get the correct file name.
if pkg.Version != "" {
licenses, err := findLicenseFromEnvDir(pkg, pkgs.Prefix)
if err != nil {
// Show log once per file
once.Do(func() {
log.WithPrefix("conda").Debug("License not found. See https://aquasecurity.github.io/trivy/latest/docs/coverage/os/conda/#licenses for details",
log.WithPrefix("conda").Debug("License not found. See https://aquasecurity.github.io/trivy/latest/docs/coverage/os/conda/#license_1 for details",
log.String("pkg", pkg.Name), log.Err(err))
})
}
Expand Down

0 comments on commit 61e9c7e

Please sign in to comment.