File tree Expand file tree Collapse file tree 3 files changed +27
-9
lines changed Expand file tree Collapse file tree 3 files changed +27
-9
lines changed Original file line number Diff line number Diff line change 37
37
- name : Build
38
38
run : make build
39
39
40
- - name : Lint
41
- uses : golangci/golangci-lint-action@v1
42
- with :
43
- # Required: the version of golangci-lint is required and must be specified
44
- # without patch version: we always use the latest patch version.
45
- version : v1.27
46
-
47
40
- name : Test
48
41
run : make test
49
42
Original file line number Diff line number Diff line change
1
+ name : golangci-lint
2
+ on :
3
+ push :
4
+ tags :
5
+ - v*
6
+ branches :
7
+ - master
8
+ pull_request :
9
+ jobs :
10
+ golangci :
11
+ name : lint
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - uses : actions/checkout@v2
15
+ - name : golangci-lint
16
+ uses : golangci/golangci-lint-action@v1
17
+ with :
18
+ # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
19
+ version : v1.29
20
+
21
+ # Optional: golangci-lint command line arguments.
22
+ args : --timeout 5m
Original file line number Diff line number Diff line change @@ -8,9 +8,12 @@ SOURCES := $(shell find . -name '*.go' -not -path "*/vendor/*" -not -pa
8
8
build : $(SOURCES ) # # Build Test
9
9
go build -i -ldflags=" -s -w" ./...
10
10
11
- lint : golangci-lint # # Run golint
11
+ lint : golangci-lint # # Run golangci-lint
12
12
@$(GOLANGCI_LINT ) run
13
13
14
+ lint-fix : golangci-lint # # Run golangci lint to automatically perform fixes
15
+ @$(GOLANGCI_LINT ) run --fix
16
+
14
17
fmt : # # Run go fmt
15
18
@gofmt -d $(SOURCES )
16
19
@@ -39,7 +42,7 @@ golangci-lint:
39
42
ifeq (, $(shell which golangci-lint) )
40
43
@{ \
41
44
set -e ;\
42
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.27 .0 ;\
45
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.29 .0 ;\
43
46
}
44
47
GOLANGCI_LINT =$(shell go env GOPATH) /bin/golangci-lint
45
48
else
You can’t perform that action at this time.
0 commit comments