Debian Codegraph @

ci/check_go_lint.sh

raw
1 #!/bin/bash
2 # This script is used by CI to check if the code passes golint.
3
4 set -u
5
6 if ! command -v golint >/dev/null; then
7 echo "error: golint not found; go get -u golang.org/x/lint/golint" >&2
8 exit 1
9 fi
10
11 GOLINT_OUTPUT=$(IFS=$'\n'; golint ./... | grep -v "mockgen/internal/.*\|sample/.*")
12 if [[ -n "${GOLINT_OUTPUT}" ]]; then
13 echo "${GOLINT_OUTPUT}"
14 echo
15 echo "The go source files aren't passing golint."
16 exit 1
17 fi