Boilerplate should ignore Go build tags

pull/6/head
Clayton Coleman 2014-08-22 21:33:43 -04:00
parent e0bf338cc5
commit 693051c1ca
1 changed files with 6 additions and 1 deletions

View File

@ -26,7 +26,12 @@ if [ ! -e $REF_FILE ]; then
fi
LINES=$(cat "${REF_FILE}" | wc -l | tr -d ' ')
DIFFER=$(head "-${LINES}" "${FILE}" | diff -q - "${REF_FILE}")
if [[ "${EXT}" == "go" ]]; then
# remove build tags from the top of Go file
DIFFER=$(cat "${FILE}" | sed '/\/\*/,$!d' | head "-${LINES}" | diff -q - "${REF_FILE}")
else
DIFFER=$(head "-${LINES}" "${FILE}" | diff -q - "${REF_FILE}")
fi
if [[ -z "${DIFFER}" ]]; then
echo "1"