mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
0c350e87a0
reference:
https://github.com/docker/cli/pull/2507
4c99c81326
Signed-off-by: Xiaodong Liu <liuxiaodong@loongson.cn>
19 lines
657 B
Bash
Executable file
19 lines
657 B
Bash
Executable file
#!/bin/sh
|
|
|
|
: "${GOLANGCI_LINT_COMMIT=v1.23.8}"
|
|
|
|
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 \
|
|
${GO_BUILDMODE} \
|
|
-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"
|
|
}
|