Skip to content

Commit 9e0997e

Browse files
authored
Update Go and golangci-lint versions (#49)
The minimum Go version for the package is now Go 1.21. This is because a future change will use the 'slices' package in test code. Note that non-test code in the package should still be compatible with older versions of Go. As part of this, also update the golangci-lint version to one that works with Go 1.21, which required replacing some deprecated linters.
1 parent 0a4e55f commit 9e0997e

File tree

3 files changed

+31
-11
lines changed

3 files changed

+31
-11
lines changed

.github/workflows/go.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ jobs:
99
name: Verify
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Set up Go 1.19
13-
uses: actions/setup-go@v3
12+
- name: Set up Go 1.21
13+
uses: actions/setup-go@v5
1414
with:
15-
go-version: 1.19
15+
go-version: 1.21
1616

1717
- name: Check out code into the Go module directory
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
1919

2020
- name: Lint
21-
uses: golangci/golangci-lint-action@v3
21+
uses: golangci/golangci-lint-action@v6
2222
with:
23-
version: v1.49
23+
version: v1.59
2424

2525
- name: Test
2626
run: go test -v ./...

.golangci.yml

+24-4
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,41 @@ run:
44
linters:
55
disable-all: true
66
enable:
7-
- deadcode
87
- errcheck
98
- gofmt
109
- goimports
11-
- golint
1210
- govet
1311
- ineffassign
1412
- misspell
13+
- revive
1514
- typecheck
1615
- unconvert
17-
- varcheck
16+
- unused
1817

1918
issues:
2019
exclude-use-default: false
2120

22-
linter-settings:
21+
linters-settings:
2322
goimports:
2423
local-prefixes: github.com/bluekeyes/go-gitdiff
24+
revive:
25+
rules:
26+
# enable all rules from golint
27+
- name: context-keys-type
28+
- name: time-naming
29+
- name: var-declaration
30+
- name: unexported-return
31+
- name: errorf
32+
- name: blank-imports
33+
- name: context-as-argument
34+
- name: dot-imports
35+
- name: error-return
36+
- name: error-strings
37+
- name: error-naming
38+
- name: exported
39+
- name: increment-decrement
40+
- name: var-naming
41+
- name: package-comments
42+
- name: range
43+
- name: receiver-naming
44+
- name: indent-error-flow

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/bluekeyes/go-gitdiff
22

3-
go 1.13
3+
go 1.21

0 commit comments

Comments
 (0)