Don't use hack/make.sh for validate-lint

hack/make.sh now does not make a difference, so simplify.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2023-04-05 20:06:40 +02:00
parent 694b1565d1
commit 82268ea8bf
2 changed files with 3 additions and 2 deletions

28
hack/validate-lint.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
IFS=$'\n'
files=( $(find . -name '*.go' | grep -v '^\./vendor/' | sort || true) )
unset IFS
errors=()
for f in "${files[@]}"; do
failedLint=$(golint "$f")
if [ "$failedLint" ]; then
errors+=( "$failedLint" )
fi
done
if [ ${#errors[@]} -eq 0 ]; then
echo 'Congratulations! All Go source files have been linted.'
else
{
echo "Errors from golint:"
for err in "${errors[@]}"; do
echo "$err"
done
echo
echo 'Please fix the above errors. You can test via "golint" and commit the result.'
echo
} >&2
exit 1
fi