3 export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4 source "${SCRIPTDIR}/.validate"
7 files=( $(validate_diff --diff-filter=ACMR --name-only -- '*.go' | grep -v '^vendor/' | grep -v '^api/types/container/' | grep -v '\.pb\.go$' || true) )
11 for f in "${files[@]}"; do
12 failedLint=$(golint "$f")
13 if [ "$failedLint" ]; then
14 errors+=( "$failedLint" )
18 if [ ${#errors[@]} -eq 0 ]; then
19 echo 'Congratulations! All Go source files have been linted.'
22 echo "Errors from golint:"
23 for err in "${errors[@]}"; do
27 echo 'Please fix the above errors. You can test via "golint" and commit the result.'