Skip to content

Commit 56a9bc2

Browse files
committed
Fix duplicate repos_path check
If the same repos_path[] element exists in a different profile, check fails wrongly.
1 parent 295db7e commit 56a9bc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lockjson/lockjson.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ func validate(lockJSON *LockJSON) error {
102102
}
103103

104104
// Validate if duplicate profiles[]/repos_path[] exist
105-
dup = make(map[string]bool, len(lockJSON.Profiles)*10)
106105
for _, profile := range lockJSON.Profiles {
106+
dup = make(map[string]bool, len(lockJSON.Profiles)*10)
107107
for _, reposPath := range profile.ReposPath {
108108
if _, exists := dup[reposPath]; exists {
109109
return errors.New("duplicate 'repos_path' (" + reposPath + ") in profile '" + profile.Name + "'")

0 commit comments

Comments
 (0)