Skip to content

Commit

Permalink
#331: Accept module prefix for matching license
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Aug 3, 2022
1 parent e73ce5b commit 092b477
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ private GolangDependencyLicense getLicense(final String moduleName) {
if (this.allLicenses.containsKey(moduleName)) {
return this.allLicenses.get(moduleName);
}
final Optional<String> prefixMatch = this.allLicenses.keySet().stream()
.filter(key -> key.startsWith(moduleName)).findAny();
if (prefixMatch.isPresent()) {
return this.allLicenses.get(prefixMatch.get());
}
return fetchLicense(moduleName);
}

Expand Down

0 comments on commit 092b477

Please sign in to comment.