2019-08-05 06:32:43 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-09-19 11:59:26 -04:00
|
|
|
: "${GOLANGCI_LINT_COMMIT=v1.20.0}"
|
2019-08-05 06:32:43 -04:00
|
|
|
|
|
|
|
install_golangci_lint() {
|
|
|
|
echo "Installing golangci-lint version ${GOLANGCI_LINT_COMMIT}"
|
|
|
|
go get -d github.com/golangci/golangci-lint/cmd/golangci-lint
|
|
|
|
cd "$GOPATH/src/github.com/golangci/golangci-lint/" || exit 1
|
|
|
|
git checkout -q "${GOLANGCI_LINT_COMMIT}"
|
2019-09-19 11:59:26 -04:00
|
|
|
|
|
|
|
version="$(git describe --tags)"
|
|
|
|
commit="$(git rev-parse --short HEAD)"
|
|
|
|
commitDate="$(git show -s --format=%cd)"
|
|
|
|
|
|
|
|
go build \
|
|
|
|
-buildmode=pie \
|
|
|
|
-ldflags "-s -w -X \"main.version=${version}\" -X \"main.commit=${commit}\" -X \"main.date=${commitDate}\"" \
|
|
|
|
-o "${PREFIX}/golangci-lint" "github.com/golangci/golangci-lint/cmd/golangci-lint"
|
2019-08-05 06:32:43 -04:00
|
|
|
}
|