Skip to content

Commit 74842be

Browse files
author
Sauyon Lee
authored
Deduplicate license file names (#18)
1 parent e11b485 commit 74842be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

license-finder.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ func copyLicenses(licenseDirs []string) error {
2525
if err != nil {
2626
return err
2727
}
28-
filenames := make([]string, 0)
28+
filenames := make(map[string]bool)
2929
{
3030
for _, match := range licenses {
3131
for fName := range match.Files {
32-
filenames = append(filenames, fName)
32+
filenames[fName] = true
3333
}
3434
}
3535
}
3636

37-
for _, licenseRelativePath := range filenames {
37+
for licenseRelativePath := range filenames {
3838
// Exclude licenses of vendored packages:
3939
if strings.Contains(licenseRelativePath, "/vendor/") {
4040
continue

0 commit comments

Comments
 (0)