mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
3280ce651b
resolves #11970 Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
22 lines
569 B
Bash
22 lines
569 B
Bash
#!/bin/bash
|
|
|
|
source "$(dirname "$BASH_SOURCE")/.validate"
|
|
|
|
IFS=$'\n'
|
|
files=( $(validate_diff --diff-filter=ACMR --name-only -- '*.go' | grep -v '^vendor/' || true) )
|
|
unset IFS
|
|
|
|
for f in "${files[@]}"; do
|
|
# we use "git show" here to validate that what's committed is vetted
|
|
failedVet=$(git show "$VALIDATE_HEAD:$f" | go vet)
|
|
if [ $failedVet ]; then
|
|
fails=yes
|
|
echo $failedVet
|
|
fi
|
|
done
|
|
|
|
if [ $fails ]; then
|
|
echo 'Please review and resolve the above issues and commit the result.'
|
|
else
|
|
echo 'All Go source files have been vetted.'
|
|
fi
|