1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/hack/make/validate-vet
bobby abbott 3280ce651b Adds validate-vet script
resolves #11970

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
2015-04-13 12:48:05 -07:00

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