Skip to content

Commit d7e99e8

Browse files
committed
chore: bump to go version 1.25
1 parent 6891287 commit d7e99e8

File tree

4 files changed

+36
-106
lines changed

4 files changed

+36
-106
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- name: Set up Go
99
uses: actions/setup-go@v5
1010
with:
11-
go-version: 1.22
11+
go-version: 1.25
1212
id: go
1313

1414
- name: Check out code into the Go module directory

.golangci.yml

Lines changed: 33 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,183 +1,119 @@
1+
version: "2"
2+
13
run:
24
timeout: 1m
35

46
linters-settings:
57
errcheck:
6-
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
7-
# default is false: such cases aren't reported by default.
88
check-type-assertions: true
9-
10-
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
11-
# default is false: such cases aren't reported by default.
129
check-blank: false
1310

14-
# [deprecated] comma-separated list of pairs of the form pkg:regex
15-
# the regex is used to ignore names within pkg. (default "fmt:.*").
16-
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
17-
# ignore: fmt:.*,io/ioutil:^Read.*
18-
19-
# path to a file containing a list of functions to exclude from checking
20-
# see https://github.com/kisielk/errcheck#excluding-functions for details
21-
# exclude: /path/to/file.txt
22-
2311
funlen:
2412
lines: 50
2513
statements: 40
2614

2715
govet:
28-
# report about shadowed variables
29-
shadow: true
30-
31-
# enable or disable analyzers by name
32-
# enable:
33-
# - atomicalign
3416
enable-all: true
3517
disable:
3618
- fieldalignment
37-
# disable-all: false
38-
revive:
39-
# minimal confidence for issues, default is 0.8
40-
min-confidence: 0.8
19+
4120
gofmt:
42-
# simplify code: gofmt with `-s` option, true by default
4321
simplify: true
22+
4423
goimports:
45-
# put imports beginning with prefix after 3rd-party packages;
46-
# it's a comma-separated list of prefixes
4724
local-prefixes: github.com/kinbiko/bugsnag
25+
4826
gocyclo:
49-
# minimal code complexity to report, 30 by default (but we recommend 10-20)
50-
# This check is set to an unreasonably low number by most developers'
51-
# standards to track the code standard over time
5227
min-complexity: 10
28+
5329
gocognit:
54-
# minimal code complexity to report, 30 by default (but we recommend 10-20)
55-
# This check is a more useful cyclomatic complexity called cognitive complexity,
56-
# where nested if/for is weighted more, and only one point regardless of
57-
# cases in a switch.
5830
min-complexity: 11
31+
5932
dupl:
60-
# tokens count to trigger issue, 150 by default
6133
threshold: 100
34+
6235
goconst:
63-
# minimal length of string constant, 3 by default
6436
min-len: 10
65-
# minimal occurrences count to trigger, 3 by default
6637
min-occurrences: 3
6738

68-
# packages-with-error-messages:
69-
# specify an error message to output when a blacklisted package is used
70-
# github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
7139
misspell:
72-
# Correct spellings using locale preferences for US or UK.
73-
# Default is to use a neutral variety of English.
74-
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
7540
locale: US
76-
# ignore-words:
77-
# - someword
41+
7842
lll:
79-
# max line length, lines longer will be reported. Default is 120.
80-
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
8143
line-length: 165
82-
# tab width in spaces. Default to 1.
8344
tab-width: 4
84-
unused:
85-
# treat code as a program (not a library) and report unused exported identifiers; default is false.
86-
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
87-
# if it's called for subdir of a project it can't find funcs usages. All text editor integrations
88-
# with golangci-lint call it on a directory with the changed file.
89-
check-exported: false
45+
9046
unparam:
91-
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
92-
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
93-
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
94-
# with golangci-lint call it on a directory with the changed file.
9547
check-exported: true
48+
9649
nakedret:
97-
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
98-
# Naked returns can go plop itself
9950
max-func-lines: 0
100-
prealloc:
101-
# XXX: we don't recommend using this linter before doing performance profiling.
102-
# For most programs usage of prealloc will be a premature optimization.
10351

104-
# Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
105-
# True by default.
52+
prealloc:
10653
simple: true
107-
range-loops: true # Report preallocation suggestions on range loops, true by default
108-
for-loops: false # Report preallocation suggestions on for loops, false by default
54+
range-loops: true
55+
for-loops: false
56+
10957
gocritic:
110-
# Which checks should be enabled; can't be combined with 'disabled-checks';
111-
# See https://go-critic.github.io/overview#checks-overview
112-
# To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
113-
# By default list of stable checks is used.
114-
# enabled-checks:
115-
# - badCond
116-
117-
# Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
118-
# disabled-checks:
119-
120-
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.
121-
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
12258
enabled-tags:
12359
- diagnostic
12460
- style
12561
- performance
126-
127-
settings: # settings passed to gocritic
128-
captLocal: # must be valid enabled check name
62+
settings:
63+
captLocal:
12964
paramsOnly: true
13065
rangeValCopy:
13166
sizeThreshold: 64
67+
13268
godox:
133-
# report any comments starting with keywords, this is useful for TODO or FIXME comments that
134-
# might be left in the code accidentally and should be resolved before merging
135-
keywords: # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting
69+
keywords:
13670
- TODO
13771
- FIXME
72+
13873
dogsled:
139-
# checks assignments with too many blank identifiers; default is 2
14074
max-blank-identifiers: 2
14175

14276
whitespace:
143-
multi-if: false # Enforces newlines (or comments) after every multi-line if statement
144-
multi-func: false # Enforces newlines (or comments) after every multi-line function signature
77+
multi-if: false
78+
multi-func: false
14579

14680
linters:
14781
disable:
14882
- wsl
14983
- godot
15084
- nlreturn
151-
15285
- depguard
153-
154-
- gci # This conflicts with goimports
155-
- varnamelen # This has too many false positives around indexes etc to be useful
86+
- varnamelen
87+
settings:
88+
staticcheck:
89+
checks:
90+
- "all"
91+
- "-QF1008" # Don't suggest removing embedded field from selector
15692
presets:
15793
- bugs
15894
- complexity
15995
- format
16096
- performance
16197
- style
16298
- unused
163-
fast: false
99+
100+
formatters:
101+
enable:
102+
- gofmt
103+
- goimports
164104

165105
issues:
166-
# Excluding configuration per-path, per-linter, per-text and per-source
167106
exclude-rules:
168-
# Exclude some linters from running on tests files.
169107
- path: _test\.go
170108
linters:
171109
- cyclop
172110
- dupl
173111
- errcheck
174112
- errchkjson
175-
- exhaustivestruct
176113
- forbidigo
177114
- funlen
178115
- gocognit
179116
- gocyclo
180-
- gomnd
181117
- lll
182118
- stylecheck
183119
- testpackage
@@ -187,12 +123,6 @@ issues:
187123
linters:
188124
- err113
189125

190-
# Independently from option `exclude` we use default exclude patterns,
191-
# it can be disabled by this option. To list all
192-
# excluded by default patterns execute `golangci-lint run --help`.
193-
# Default value for this option is true.
194126
exclude-use-default: false
195-
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
196127
max-issues-per-linter: 0
197-
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
198128
max-same-issues: 0

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
LINTER_VERSION := v1.61.0
1+
LINTER_VERSION := v2.4.0
22

33
.PHONY: check
44
check: lint test

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/kinbiko/jsonassert
22

3-
go 1.22
3+
go 1.25

0 commit comments

Comments
 (0)