Skip to content

Commit

Permalink
refactor: update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen committed Jun 6, 2024
1 parent a2d1871 commit b8e52c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/dependency/parser/nodejs/npm/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ func (p *Parser) resolveLinks(packages map[string]Package) {
}

workspaces := rootPkg.Workspaces
// Clone packages to avoid cases when we check already updated packages
// Changing the map during the map iteration causes unexpected behavior,
// so we need to iterate over the cloned `packages` map, but change the original `packages` map.
for pkgPath, pkg := range maps.Clone(packages) {
for linkPath, link := range links {
if !strings.HasPrefix(pkgPath, link.Resolved) {
Expand Down

0 comments on commit b8e52c4

Please sign in to comment.