diff --git a/golang/src/com/google/idea/blaze/golang/resolve/BlazeGoPackage.java b/golang/src/com/google/idea/blaze/golang/resolve/BlazeGoPackage.java index 2388ae4c7ef..d80885fd0ad 100644 --- a/golang/src/com/google/idea/blaze/golang/resolve/BlazeGoPackage.java +++ b/golang/src/com/google/idea/blaze/golang/resolve/BlazeGoPackage.java @@ -272,6 +272,7 @@ private static String getPackageName(Project project, Collection files, St .map(psiManager::findFile) .filter(GoFile.class::isInstance) .map(GoFile.class::cast) + .filter(goFile -> !Objects.equals(goFile.getBuildFlags(), "ignore")) .map(GoFile::getCanonicalPackageName) // strips _test suffix from test packages .filter(Objects::nonNull) .findFirst() // short circuit