validate 549 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. set -e
  3. cd $(dirname $0)/..
  4. echo Running validation
  5. PACKAGES=". $(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')"
  6. echo Running: go vet
  7. go vet ${PACKAGES}
  8. #echo Running: golint
  9. #for i in ${PACKAGES}; do
  10. # if [ -n "$(golint $i | grep -v 'should have comment.*or be unexported' | tee /dev/stderr)" ]; then
  11. # failed=true
  12. # fi
  13. #done
  14. test -z "$failed"
  15. echo Running: go fmt
  16. test -z "$(go fmt ${PACKAGES} | tee /dev/stderr)"