From 29d73fba13785a826e477e33c64e08c450073425 Mon Sep 17 00:00:00 2001 From: DmitriyLewen Date: Thu, 21 Nov 2024 17:13:48 +0600 Subject: [PATCH] refactor: don't check len(dependsOn) --- pkg/dependency/parser/golang/mod/parse.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/dependency/parser/golang/mod/parse.go b/pkg/dependency/parser/golang/mod/parse.go index e22f12fd957d..f108b2101890 100644 --- a/pkg/dependency/parser/golang/mod/parse.go +++ b/pkg/dependency/parser/golang/mod/parse.go @@ -170,13 +170,11 @@ func (p *Parser) Parse(r xio.ReadSeekerAt) ([]ftypes.Package, []ftypes.Dependenc return pkg.ID, pkg.Relationship == ftypes.RelationshipDirect }) - if len(dependsOn) > 0 { - sort.Strings(dependsOn) - deps = append(deps, ftypes.Dependency{ - ID: root.ID, - DependsOn: dependsOn, - }) - } + sort.Strings(dependsOn) + deps = append(deps, ftypes.Dependency{ + ID: root.ID, + DependsOn: dependsOn, + }) pkgs[root.Name] = root }