go: Apply package exclusion equally

The exclusion logic was moved out of getGoDirs but only buildPhase was updated
causing checkPhase to possibly fail. This happened in golint as it has go
files in testdata that are meant as testdata files and not go packages to
test which caused the checkPhase to fail.

Fixes #167717
This commit is contained in:
Manuel Mendez 2022-04-08 14:21:45 -04:00 committed by zowoq
parent 6443a5d6da
commit ddcc7c67d2
2 changed files with 2 additions and 4 deletions

View file

@ -204,7 +204,7 @@ let
if [ -n "$subPackages" ]; then
echo "$subPackages" | sed "s,\(^\| \),\1./,g"
else
find . -type f -name \*$type.go -exec dirname {} \; | grep -v "/vendor/" | sort --unique
find . -type f -name \*$type.go -exec dirname {} \; | grep -v "/vendor/" | sort --unique | grep -v "$exclude"
fi
}
@ -221,7 +221,6 @@ let
export NIX_BUILD_CORES=1
fi
for pkg in $(getGoDirs ""); do
grep -q "$exclude" <<<$pkg && continue
echo "Building subPackage $pkg"
buildGoDir install "$pkg"
done

View file

@ -184,7 +184,7 @@ let
echo "$subPackages" | sed "s,\(^\| \),\1$goPackagePath/,g"
else
pushd "$NIX_BUILD_TOP/go/src" >/dev/null
find "$goPackagePath" -type f -name \*$type.go -exec dirname {} \; | grep -v "/vendor/" | sort | uniq
find "$goPackagePath" -type f -name \*$type.go -exec dirname {} \; | grep -v "/vendor/" | sort | uniq | grep -v "$exclude"
popd >/dev/null
fi
}
@ -202,7 +202,6 @@ let
export NIX_BUILD_CORES=1
fi
for pkg in $(getGoDirs ""); do
grep -q "$exclude" <<<$pkg && continue
echo "Building subPackage $pkg"
buildGoDir install "$pkg"
done