mirror of
https://github.com/containers/skopeo.git
synced 2025-10-22 11:44:05 +00:00
hack/make.sh now does not make a difference, so simplify. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
29 lines
543 B
Bash
Executable File
29 lines
543 B
Bash
Executable File
#!/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
|