From 280a7e756581e8486f6f92428ff9752e539b9bfe Mon Sep 17 00:00:00 2001 From: z1cheng Date: Thu, 6 Jul 2023 13:57:54 +0000 Subject: [PATCH] Install if golangci-lint not exists Signed-off-by: z1cheng --- hack/verify-golint.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hack/verify-golint.sh b/hack/verify-golint.sh index 690fed855..0b623c767 100755 --- a/hack/verify-golint.sh +++ b/hack/verify-golint.sh @@ -24,4 +24,11 @@ cd "${KUBE_ROOT}" LINT=${LINT:-golangci-lint} +if ! command -v ${LINT} >/dev/null 2>&1; then + echo "${LINT} is missing. Installing it now." + # See: https://golangci-lint.run/usage/install/#local-installation + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.53.3 + LINT=$(go env GOPATH)/bin/golangci-lint +fi + ${LINT} run \ No newline at end of file