github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/hack/dockerfile/install/golangci_lint.installer (about) 1 #!/bin/sh 2 3 : "${GOLANGCI_LINT_COMMIT=v1.23.8}" 4 5 install_golangci_lint() { 6 echo "Installing golangci-lint version ${GOLANGCI_LINT_COMMIT}" 7 go get -d github.com/golangci/golangci-lint/cmd/golangci-lint 8 cd "$GOPATH/src/github.com/golangci/golangci-lint/" || exit 1 9 git checkout -q "${GOLANGCI_LINT_COMMIT}" 10 11 version="$(git describe --tags)" 12 commit="$(git rev-parse --short HEAD)" 13 commitDate="$(git show -s --format=%cd)" 14 15 go build \ 16 -buildmode=pie \ 17 -ldflags "-s -w -X \"main.version=${version}\" -X \"main.commit=${commit}\" -X \"main.date=${commitDate}\"" \ 18 -o "${PREFIX}/golangci-lint" "github.com/golangci/golangci-lint/cmd/golangci-lint" 19 }