Debian Codegraph @

etc/golangci-lint.sh

raw
1 #!/usr/bin/env bash
2 set -ex
3
4 # Keep this in sync with go version used in static-analysis Evergreen build variant.
5 GO_VERSION=1.22.8
6 GOLANGCI_LINT_VERSION=1.60.1
7
8 # Unset the cross-compiler overrides while downloading binaries.
9 GOOS_ORIG=${GOOS:-}
10 export GOOS=
11 GOARCH_ORIG=${GOARCH:-}
12 export GOARCH=
13
14 go install golang.org/dl/go$GO_VERSION@latest
15 go${GO_VERSION} download
16 GOROOT="$(go${GO_VERSION} env GOROOT)"
17 PATH="$GOROOT/bin:$PATH"
18 export PATH
19 export GOROOT
20 go install github.com/golangci/golangci-lint/cmd/golangci-lint@v${GOLANGCI_LINT_VERSION}
21
22 export GOOS=$GOOS_ORIG
23 export GOARCH=$GOARCH_ORIG
24 golangci-lint run --config .golangci.yml ./...