9cb9c6eba4
release notes: - v1.20.0: https://github.com/golangci/golangci-lint/releases/tag/v1.20.0 - Add WSL linter (#771) - Add gocognit linter (#756) - govet: add more analyzers - dramatically reduce memory usage - reduce 1.5x memory usage on large repos on repeated runs - Rename deadline option to timeout and mark deadline as deprecated - v1.19.1: https://github.com/golangci/golangci-lint/releases/tag/v1.19.1 - v1.19.0: https://github.com/golangci/golangci-lint/releases/tag/v1.19.0 - Add dogsled linter. - Add whitespace linter - Add Godox linter support - Various performance optimizations - v1.18.0: https://github.com/golangci/golangci-lint/releases/tag/v1.18.0 - Support go1.13 - Update format of junit xml output to mark failures as such - Speed up linting: use deduplicated packages - Add user supplied error messages in depguard issues - Add funlen linter Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
19 lines
656 B
Bash
Executable file
19 lines
656 B
Bash
Executable file
#!/bin/sh
|
|
|
|
: "${GOLANGCI_LINT_COMMIT=v1.20.0}"
|
|
|
|
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}"
|
|
|
|
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"
|
|
}
|