Skip to content

Commit 1b0dc15

Browse files
committed
refactor: define a variable for name
Signed-off-by: knqyf263 <[email protected]>
1 parent 5f4f5c9 commit 1b0dc15

File tree

1 file changed

+10
-4
lines changed
  • pkg/dependency/parser/sbt/lockfile

1 file changed

+10
-4
lines changed

pkg/dependency/parser/sbt/lockfile/parse.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,17 @@ func (Parser) Parse(r xio.ReadSeekerAt) ([]ftypes.Package, []ftypes.Dependency,
4949

5050
for _, dep := range lockfile.Dependencies {
5151
if slices.ContainsFunc(dep.Configurations, isIncludedConfig) {
52+
name := dep.Organization + ":" + dep.Name
5253
libraries = append(libraries, ftypes.Package{
53-
ID: dependency.ID(ftypes.Sbt, dep.Organization+":"+dep.Name, dep.Version),
54-
Name: dep.Organization + ":" + dep.Name,
55-
Version: dep.Version,
56-
Locations: []ftypes.Location{{StartLine: dep.StartLine, EndLine: dep.EndLine}},
54+
ID: dependency.ID(ftypes.Sbt, name, dep.Version),
55+
Name: name,
56+
Version: dep.Version,
57+
Locations: []ftypes.Location{
58+
{
59+
StartLine: dep.StartLine,
60+
EndLine: dep.EndLine,
61+
},
62+
},
5763
})
5864
}
5965
}

0 commit comments

Comments
 (0)