prune: Fix handling of "legal" source files

Do not consider source files in the scope of isPreservedFile().
Those are properly handled in the unused package logic.
This commit is contained in:
Yann Hodique 2018-02-06 19:07:34 -08:00
Родитель 5029495a63
Коммит 03ec624619
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -322,7 +322,12 @@ func pruneNonGoFiles(fsState filesystemState) error {
// isPreservedFile checks if the file name indicates that the file should be
// preserved based on licenseFilePrefixes or legalFileSubstrings.
// This applies only to non-source files.
func isPreservedFile(name string) bool {
if isSourceFile(name) {
return false
}
name = strings.ToLower(name)
for _, prefix := range licenseFilePrefixes {