File tree 2 files changed +12
-13
lines changed
2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ BUILD_NUMBER?=unknown
44
44
GO111MODULE_FLAG? =on
45
45
export GO111MODULE =$(GO111MODULE_FLAG )
46
46
47
- export LINT_VERSION ="1.60.1"
47
+ LINT_VERSION =v2.0.2
48
48
49
49
GOFILES =$(shell find . -type f -name '* .go' -not -path "./vendor/* ")
50
50
@@ -60,28 +60,26 @@ driver: deps buildimage
60
60
.PHONY : deps
61
61
deps :
62
62
echo " Installing dependencies ..."
63
- @if ! which golangci-lint > /dev/null || [[ " $$ (golangci-lint --version)" != * ${LINT_VERSION} * ]]; then \
64
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v${LINT_VERSION} ; \
65
- fi
63
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH ) /bin ${LINT_VERSION}
66
64
67
65
.PHONY : fmt
68
66
fmt : lint
69
67
gofmt -l ${GOFILES}
70
68
71
69
.PHONY : dofmt
72
- dofmt :
70
+ dofmt : deps
73
71
$(GOPATH ) /bin/golangci-lint run --disable-all --enable=gofmt --fix --timeout 600s
74
72
75
73
.PHONY : lint
76
- lint :
74
+ lint : deps
77
75
hack/verify-golint.sh
78
76
79
77
.PHONY : build
80
78
build :
81
79
CGO_ENABLED=0 GOOS=$(shell go env GOOS) GOARCH=$(shell go env GOARCH) go build -mod=vendor -a -ldflags ' -X main.vendorVersion=' " ${DRIVER_NAME} -${GIT_COMMIT_SHA} " ' -extldflags "-static"' -o ${GOPATH} /bin/${EXE_DRIVER_NAME} ./cmd/
82
80
83
81
.PHONY : verify
84
- verify :
82
+ verify : deps
85
83
echo " Verifying and linting files ..."
86
84
./hack/verify-all.sh
87
85
echo " Congratulations! All Go source files have been linted."
Original file line number Diff line number Diff line change 15
15
# limitations under the License.
16
16
17
17
set -euo pipefail
18
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $( go env GOPATH ) /bin latest
19
- if [[ -z " $( command -v golangci-lint) " ]] ; then
20
- echo " Cannot find golangci-lint. Installing golangci-lint... "
21
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $( go env GOPATH ) /bin v1.60.1
22
- export PATH= $PATH : $( go env GOPATH ) /bin
18
+
19
+ LINT_CMD= $( go env GOPATH ) /bin/ golangci-lint
20
+ if [[ -z " $( command -v ${LINT_CMD} ) " ]] ; then
21
+ echo " Cannot find ${LINT_CMD} "
22
+ exit 1
23
23
fi
24
24
25
25
echo " Verifying golint"
26
26
readonly PKG_ROOT=" $( git rev-parse --show-toplevel) "
27
27
28
- golangci-lint run --timeout=10m
28
+ ${LINT_CMD} version
29
+ ${LINT_CMD} run --timeout=10m
29
30
30
31
echo " Congratulations! Lint check completed for all Go source files."
You can’t perform that action at this time.
0 commit comments