Source:
<code>protected void checkFile(@NotNull GoFile file, @NotNull ProblemsHolder problemsHolder) { MultiMap<String, GoImportSpec> importMap = file.getImportMap(); for (PsiElement importIdentifier : GoImportOptimizer.findRedundantImportIdentifiers(importMap)) { problemsHolder.registerProblem(importIdentifier, "Redundant alias", ProblemHighlightType.LIKE_UNUSED_SYMBOL, OPTIMIZE_QUICK_FIX); } Set<GoImportSpec> duplicatedEntries = GoImportOptimizer.findDuplicatedEntries(importMap); for (GoImportSpec duplicatedImportSpec : duplicatedEntries) { problemsHolder.registerProblem(duplicatedImportSpec, "Redeclared import", ProblemHighlightType.GENERIC_ERROR, OPTIMIZE_QUICK_FIX); } for (Map.Entry<String, Collection<GoImportSpec>> specs : importMap.entrySet()) { <START> if (".".equals(specs.getKey()) || "_".equals(specs.getKey())) { <END> continue; } Iterator<GoImportSpec> imports = specs.getValue().iterator(); imports.next(); while (imports.hasNext()) { GoImportSpec redeclaredImport = imports.next(); if (!duplicatedEntries.contains(redeclaredImport)) { problemsHolder.registerProblem(redeclaredImport, "Redeclared import", ProblemHighlightType.GENERIC_ERROR); } } } if (!problemsHolder.isOnTheFly()) { resolveAllReferences(file); } for (PsiElement importEntry : GoImportOptimizer.filterUnusedImports(file, importMap).values()) { GoImportSpec spec = GoImportOptimizer.getImportSpec(importEntry); if (spec != null) { if (spec.getImportString().resolve() != null) { problemsHolder.registerProblem(spec, "Unused import", ProblemHighlightType.GENERIC_ERROR, OPTIMIZE_QUICK_FIX); } } } }</code><technical_language>Please reimplement invoking isDot isForSideEffects imports.next() object</technical_language>

Target:
protected void checkFile(@NotNull GoFile file, @NotNull ProblemsHolder problemsHolder) { MultiMap<String, GoImportSpec> importMap = file.getImportMap(); for (PsiElement importIdentifier : GoImportOptimizer.findRedundantImportIdentifiers(importMap)) { problemsHolder.registerProblem(importIdentifier, "Redundant alias", ProblemHighlightType.LIKE_UNUSED_SYMBOL, OPTIMIZE_QUICK_FIX); } Set<GoImportSpec> duplicatedEntries = GoImportOptimizer.findDuplicatedEntries(importMap); for (GoImportSpec duplicatedImportSpec : duplicatedEntries) { problemsHolder.registerProblem(duplicatedImportSpec, "Redeclared import", ProblemHighlightType.GENERIC_ERROR, OPTIMIZE_QUICK_FIX); } for (Map.Entry<String, Collection<GoImportSpec>> specs : importMap.entrySet()) { Iterator<GoImportSpec> imports = specs.getValue().iterator(); GoImportSpec originalImport = imports.next(); if (originalImport.isDot() || originalImport.isForSideEffects()) { continue; } while (imports.hasNext()) { GoImportSpec redeclaredImport = imports.next(); if (!duplicatedEntries.contains(redeclaredImport)) { problemsHolder.registerProblem(redeclaredImport, "Redeclared import", ProblemHighlightType.GENERIC_ERROR); } } } if (!problemsHolder.isOnTheFly()) { resolveAllReferences(file); } for (PsiElement importEntry : GoImportOptimizer.filterUnusedImports(file, importMap).values()) { GoImportSpec spec = GoImportOptimizer.getImportSpec(importEntry); if (spec != null) { if (spec.getImportString().resolve() != null) { problemsHolder.registerProblem(spec, "Unused import", ProblemHighlightType.GENERIC_ERROR, OPTIMIZE_QUICK_FIX); } } } }