Skip to content

Commit 07a6fc1

Browse files
committed
Resolve all reference if there is a dot-import
1 parent e5bc012 commit 07a6fc1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/com/goide/inspections/GoUnusedImportInspection.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ protected void checkFile(@NotNull GoFile file, @NotNull ProblemsHolder problemsH
105105
}
106106
}
107107

108-
if (!problemsHolder.isOnTheFly() || ApplicationManager.getApplication().isUnitTestMode()) resolveAllReferences(file);
108+
if (importMap.containsKey(".")) {
109+
if (!problemsHolder.isOnTheFly() || ApplicationManager.getApplication().isUnitTestMode()) resolveAllReferences(file);
110+
}
109111
MultiMap<String, GoImportSpec> unusedImportsMap = GoImportOptimizer.filterUnusedImports(file, importMap);
110112
Set<GoImportSpec> unusedImportSpecs = ContainerUtil.newHashSet(unusedImportsMap.values());
111113
for (PsiElement importEntry : unusedImportSpecs) {

0 commit comments

Comments
 (0)