mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
23 lines
569 B
Text
23 lines
569 B
Text
|
#!/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
|