github.com/nak3/source-to-image@v1.1.10-0.20180319140719-2ed55639898d/hack/verify-golint.sh (about) 1 #!/bin/bash 2 3 set -o errexit 4 set -o nounset 5 set -o pipefail 6 7 echo $(go version) 8 9 if ! which golint &>/dev/null; then 10 echo "Unable to detect 'golint' package" 11 echo "To install it, run: 'go get github.com/golang/lint/golint'" 12 exit 1 13 fi 14 15 S2I_ROOT=$(dirname "${BASH_SOURCE}")/.. 16 source "${S2I_ROOT}/hack/util.sh" 17 18 cd "${S2I_ROOT}" 19 20 bad_files=$(s2i::util::find_files | xargs -n1 golint) 21 22 if [[ -n "${bad_files}" ]]; then 23 echo "!!! golint detected the following problems:" 24 echo "${bad_files}" 25 exit 1 26 fi