Install if golangci-lint not exists
Signed-off-by: z1cheng <imchench@gmail.com>
This commit is contained in:
parent
facf582069
commit
280a7e7565
1 changed files with 7 additions and 0 deletions
|
@ -24,4 +24,11 @@ cd "${KUBE_ROOT}"
|
||||||
|
|
||||||
LINT=${LINT:-golangci-lint}
|
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
|
${LINT} run
|
Loading…
Reference in a new issue