From 8d40201a5e2f66373c407a273aaeb88ec76e189b Mon Sep 17 00:00:00 2001 From: Robin Eklind Date: Tue, 2 Jul 2019 14:18:57 +0800 Subject: [PATCH] ci: run golangci-lint only if tool is present This is used to mitigate CI failure when go get fails for golangci-lint (ref https://github.com/golangci/golangci-lint/issues/595) --- ci_checks.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ci_checks.sh b/ci_checks.sh index 93a444c..e6e0c1e 100644 --- a/ci_checks.sh +++ b/ci_checks.sh @@ -51,10 +51,12 @@ if [ "${COVERALLS_TOKEN}" ]; then goveralls -coverprofile coverage.out -service travis-ci -repotoken ${COVERALLS_TOKEN} fi -echo "### GolangCI-Lint" -golangci-lint run --enable-all -GOLANGCI_LINT_FAIL=$? -echo +if [ -x "$(command -v golangci-lint)" ]; then + echo "### GolangCI-Lint" + golangci-lint run --enable-all + GOLANGCI_LINT_FAIL=$? + echo +fi RET=0 if [ ${GOFMT_FAIL} -eq 1 ] ; then