Skip to content

Commit 1ecd706

Browse files
committed
update golangci-lint/github workflows
- use go 1.23.5 to match Sync Gateway - update golangci-lint versions - remove deprecated linters in .golanci.yml, only explicitly disable linters that are active
1 parent 13a798c commit 1ecd706

File tree

2 files changed

+14
-48
lines changed

2 files changed

+14
-48
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- uses: actions/checkout@v4
3030
- uses: actions/setup-go@v5
3131
with:
32-
go-version: 1.22.8
32+
go-version: 1.23.5
3333
- run: go install github.com/google/addlicense@latest
3434
- run: addlicense -check -f licenses/addlicense.tmpl .
3535

@@ -43,15 +43,15 @@ jobs:
4343
- uses: actions/checkout@v4
4444
- uses: actions/setup-go@v5
4545
with:
46-
go-version: 1.22.8
46+
go-version: 1.23.5
4747
- name: Build
4848
run: go build -v "./..."
4949
- name: Run Tests
5050
run: go test -timeout=30m -count=1 -json -v "./..." | tee test.json | jq -s -jr 'sort_by(.Package,.Time) | .[].Output | select (. != null )'
5151
shell: bash
5252
- name: Annotate Failures
5353
if: always()
54-
uses: guyarb/golang-test-annotations@v0.6.0
54+
uses: guyarb/golang-test-annotations@v0.8.0
5555
with:
5656
test-results: test.json
5757

@@ -64,15 +64,15 @@ jobs:
6464
- name: golangci-lint
6565
uses: golangci/golangci-lint-action@v6
6666
with:
67-
version: v1.61.0
67+
version: v1.63.4
6868

6969
test-race:
7070
runs-on: ubuntu-latest
7171
steps:
7272
- uses: actions/checkout@v4
7373
- uses: actions/setup-go@v5
7474
with:
75-
go-version: 1.22.8
75+
go-version: 1.23.5
7676
- name: Run Tests
7777
run: go test -race -timeout=30m -count=1 -json -v "./..." | tee test.json | jq -s -jr 'sort_by(.Package,.Time) | .[].Output | select (. != null )'
7878
shell: bash
@@ -91,7 +91,7 @@ jobs:
9191
- uses: actions/checkout@v4
9292
- uses: actions/setup-go@v5
9393
with:
94-
go-version: 1.22.8
94+
go-version: 1.23.5
9595
- name: Build
9696
run: cd example && go build -v "./..."
9797
permissions:
@@ -110,5 +110,5 @@ jobs:
110110
- name: golangci-lint
111111
uses: golangci/golangci-lint-action@v6
112112
with:
113-
version: v1.61.0
113+
version: v1.63.4
114114
working-directory: example

.golangci.yml

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,62 +11,28 @@
1111
linters:
1212
enable:
1313
#- bodyclose # checks whether HTTP response body is closed successfully
14-
#- dupl # Tool for code clone detection
14+
- dupl # Tool for code clone detection
1515
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
16-
#- goconst # Finds repeated strings that could be replaced by a constant
16+
# - goconst # Finds repeated strings that could be replaced by a constant
1717
#- gocritic # The most opinionated Go source code linter
1818
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports
1919
#- goprintffuncname # Checks that printf-like functions are named with `f` at the end
2020
#- gosec # (gas) Inspects source code for security problems
2121
#- gosimple # (megacheck) Linter for Go source code that specializes in simplifying a code
2222
- govet # (vet, vetshadow) Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
2323
- ineffassign # Detects when assignments to existing variables are not used
24-
#- nakedret # Finds naked returns in functions greater than a specified function length
25-
#- prealloc # Finds slice declarations that could potentially be preallocated
24+
- misspell # Finds commonly misspelled English words in comments
25+
- nakedret # Finds naked returns in functions greater than a specified function length
26+
- prealloc # Finds slice declarations that could potentially be preallocated
2627
#- revive # Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes
2728
- staticcheck # (megacheck) Staticcheck is a go vet on steroids, applying a ton of static analysis checks
28-
#- structcheck # Finds unused struct fields
2929
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
3030
#- unconvert # Remove unnecessary type conversions
31-
#- unparam # Reports unused function parameters
31+
- unparam # Reports unused function parameters
3232
#- unused # (megacheck) Checks Go code for unused constants, variables, functions and types
3333
disable:
34-
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
35-
- depguard # Go linter that checks if package imports are in a list of acceptable packages
36-
- dogsled # Checks assignments with too many blank identifiers # (e.g. x, _, _, _, := f())
37-
- funlen # Tool for detection of long functions
38-
- gochecknoglobals # Checks that no globals are present in Go code
39-
- gochecknoinits # Checks that no init functions are present in Go code
40-
- gocognit # Computes and checks the cognitive complexity of functions
41-
- gocyclo # Computes and checks the cyclomatic complexity of functions
42-
- godot # Check if comments end in a period
43-
- godox # Tool for detection of FIXME, TODO and other comment keywords
44-
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
45-
- gomnd # An analyzer to detect magic numbers.
46-
- gomodguard # Allow and block list linter for direct Go module dependencies.
47-
- lll # Reports long lines
48-
- misspell # Finds commonly misspelled English words in comments
49-
- nestif # Reports deeply nested if statements
50-
- nolintlint # Reports ill-formed or insufficient nolint directives
51-
- rowserrcheck # checks whether Err of rows is checked successfully
52-
- stylecheck # Stylecheck is a replacement for golint
53-
- testpackage # linter that makes you use a separate _test package
54-
- unused # (megacheck) Checks Go code for unused constants, variables, functions and types
55-
- whitespace # Tool for detection of leading and trailing whitespace
56-
- wsl # Whitespace Linter - Forces you to use empty lines!
57-
# Once fixed, should enable
58-
- bodyclose # checks whether HTTP response body is closed successfully
59-
- dupl # Tool for code clone detection
60-
- goconst # Finds repeated strings that could be replaced by a constant
61-
- gocritic # The most opinionated Go source code linter
62-
- goprintffuncname # Checks that printf-like functions are named with `f` at the end
63-
- gosec # (gas) Inspects source code for security problems
6434
- gosimple # (megacheck) Linter for Go source code that specializes in simplifying a code
65-
- nakedret # Finds naked returns in functions greater than a specified function length
66-
- prealloc # Finds slice declarations that could potentially be preallocated
67-
- revive # Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes
68-
- unconvert # Remove unnecessary type conversions
69-
- unparam # Reports unused function parameters
35+
- unused # (megacheck) Checks Go code for unused constants, variables, functions and types
7036

7137
# Don't enable fieldalignment, changing the field alignment requires checking to see if anyone uses constructors
7238
# without names. If there is a memory issue on a specific field, that is best found with a heap profile.

0 commit comments

Comments
 (0)