Skip to content

Commit ea25c72

Browse files
authored
feat: update go (#38)
1 parent 80cac3d commit ea25c72

File tree

6 files changed

+194
-76
lines changed

6 files changed

+194
-76
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v3
13-
- name: Setup Go
14-
uses: actions/setup-go@v2
13+
- uses: actions/setup-go@v5
1514
with:
16-
go-version: 1.18
15+
go-version-file: "go.mod"
16+
cache-dependency-path: "go.sum"
1717
- name: Run build binary
1818
run: make build
1919
- name: Setup make

.github/workflows/release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,18 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
1919
- name: Fetch all tags
2020
run: git fetch --force --tags
2121
- name: Set up Go
22-
uses: actions/setup-go@v2
22+
uses: actions/setup-go@v5
2323
with:
24-
go-version: 1.18
24+
go-version-file: "go.mod"
25+
cache-dependency-path: "go.sum"
2526
- name: Run GoReleaser
26-
uses: goreleaser/goreleaser-action@v2
27+
uses: goreleaser/goreleaser-action@v6
2728
with:
2829
distribution: goreleaser
2930
version: latest

.golangci.yml

Lines changed: 171 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,197 @@
1+
version: "2"
12
run:
2-
concurrency: 4
3-
timeout: 5m
4-
issues-exit-code: 1
5-
tests: true
6-
modules-download-mode: readonly
7-
allow-parallel-runners: true
8-
9-
output:
10-
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
11-
format: colored-line-number
12-
print-issued-lines: false
13-
sort-results: true
14-
3+
tests: false
154
linters:
16-
disable-all: true
5+
default: none
176
enable:
7+
- asasalint
8+
- asciicheck
9+
- bidichk
1810
- bodyclose
19-
- deadcode
20-
- depguard
11+
- canonicalheader
12+
- contextcheck
13+
- copyloopvar
14+
- cyclop
15+
- decorder
2116
- dogsled
22-
- dupl
23-
- lll
17+
- dupword
18+
- durationcheck
19+
- err113
2420
- errcheck
21+
- errname
22+
- errorlint
2523
- exhaustive
24+
- fatcontext
25+
- forbidigo
2626
- funlen
27+
- ginkgolinter
28+
- gocheckcompilerdirectives
29+
- gochecknoglobals
2730
- gochecknoinits
31+
- gochecksumtype
32+
- gocognit
2833
- goconst
34+
- gocritic
2935
- gocyclo
30-
- gofmt
31-
- goimports
32-
- revive
33-
- gomnd
36+
- godot
37+
- goheader
38+
- gomoddirectives
39+
- gomodguard
3440
- goprintffuncname
3541
- gosec
36-
- gosimple
42+
- gosmopolitan
3743
- govet
44+
- grouper
45+
- importas
46+
- inamedparam
3847
- ineffassign
48+
- interfacebloat
49+
- intrange
50+
- loggercheck
51+
- maintidx
52+
- makezero
53+
- mirror
3954
- misspell
55+
- mnd
56+
- musttag
4057
- nakedret
58+
- nestif
59+
- nilerr
60+
- nilnil
4161
- noctx
4262
- nolintlint
63+
- nosprintfhostport
64+
- perfsprint
65+
- predeclared
66+
- promlinter
67+
- protogetter
68+
- reassign
69+
- revive
4370
- rowserrcheck
44-
- prealloc
45-
- exportloopref
71+
- sloglint
72+
- spancheck
73+
- sqlclosecheck
4674
- staticcheck
47-
- structcheck
48-
- stylecheck
49-
- typecheck
75+
- tagliatelle
76+
- testableexamples
77+
- testifylint
78+
- thelper
79+
- tparallel
5080
- unconvert
5181
- unparam
5282
- unused
53-
- varcheck
54-
- nlreturn
83+
- usestdlibvars
84+
- usetesting
85+
- wastedassign
5586
- whitespace
56-
- gocritic
57-
- exportloopref
58-
- gocognit
87+
- wrapcheck
88+
- zerologlint
89+
settings:
90+
cyclop:
91+
max-complexity: 30
92+
package-average: 10
93+
errcheck:
94+
check-type-assertions: true
95+
funlen:
96+
lines: 100
97+
ignore-comments: true
98+
gocritic:
99+
settings:
100+
captLocal:
101+
paramsOnly: false
102+
underef:
103+
skipRecvDeref: false
104+
godot:
105+
capital: true
106+
gosec:
107+
config:
108+
G101:
109+
pattern: (?i)passwd|pass|password|pwd|secret|token|pw|apiKey|bearer|credential
110+
global:
111+
"#nosec": gosec-ignore
112+
govet:
113+
disable:
114+
- fieldalignment
115+
enable-all: true
116+
inamedparam:
117+
skip-single-param: true
118+
mnd:
119+
ignored-functions:
120+
- args.Error
121+
- flag.Arg
122+
- flag.Duration.*
123+
- flag.Float.*
124+
- flag.Int.*
125+
- flag.Uint.*
126+
- os.Chmod
127+
- os.Mkdir.*
128+
- os.OpenFile
129+
- os.WriteFile
130+
- prometheus.ExponentialBuckets.*
131+
- prometheus.LinearBuckets
132+
nlreturn:
133+
block-size: 3
134+
nolintlint:
135+
require-specific: true
136+
perfsprint:
137+
strconcat: false
138+
revive:
139+
rules:
140+
- name: unused-parameter
141+
disabled: true
142+
rowserrcheck:
143+
packages:
144+
- github.com/jmoiron/sqlx
145+
tagliatelle:
146+
case:
147+
rules:
148+
json: snake
149+
testpackage:
150+
skip-regexp: _internal_test\.go
151+
varnamelen:
152+
max-distance: 6
153+
exclusions:
154+
generated: lax
155+
presets:
156+
- comments
157+
- common-false-positives
158+
- legacy
159+
- std-error-handling
160+
rules:
161+
- linters:
162+
- unparam
163+
text: result \d+ \([^)]+\) is always
164+
paths:
165+
- \.pb\.go$
166+
- \.connect\.go$
167+
- \.sql\.go$
168+
- _templ\.go$
169+
- migrate\.go
170+
- ^.git
171+
- ^api
172+
- ^proto
173+
- ^test
174+
- third_party$
175+
- builtin$
176+
- examples$
177+
formatters:
178+
enable:
179+
- gci
180+
- gofmt
59181
- gofumpt
60-
- godot
61-
62-
fast: false
63-
64-
issues:
65-
max-same-issues: 50
66-
max-issues-per-linter: 100
67-
68-
linters-settings:
69-
funlen:
70-
lines: 120
71-
# stmtLimit: 100
72-
lll:
73-
line-length: 160
74-
gomnd:
75-
settings:
76-
mnd:
77-
checks: argument,case,condition,return
78-
errcheck:
79-
check-type-assertions: true
80-
check-blank: true
81-
gocognit:
82-
# minimal code complexity to report, 30 by default (but we recommend 10-20)
83-
min-complexity: 15
84-
gocyclo:
85-
# minimal code complexity to report, 30 by default (but we recommend 10-20)
86-
min-complexity: 10
87-
godot:
88-
# comments to be checked: `declarations`, `toplevel`, or `all`
89-
scope: declarations
90-
# check that each sentence starts with a capital letter
91-
capital: true
92-
govet:
93-
# report about shadowed variables
94-
check-shadowing: true
182+
- goimports
183+
exclusions:
184+
generated: lax
185+
paths:
186+
- \.pb\.go$
187+
- \.connect\.go$
188+
- \.sql\.go$
189+
- _templ\.go$
190+
- migrate\.go
191+
- ^.git
192+
- ^api
193+
- ^proto
194+
- ^test
195+
- third_party$
196+
- builtin$
197+
- examples$

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ run: fresh
3232

3333
fresh: clean build
3434

35+
deps:
36+
go mod tidy -v
3537

3638
test:
3739
go test -race -count=1 -v --coverprofile=coverage.txt ./...

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/neurocode-io/cache-offloader
22

3-
go 1.18
3+
go 1.24.2
44

55
require (
66
github.com/go-redis/redis/v8 v8.11.5

go.sum

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
99
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
1010
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
1111
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
12+
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
1213
github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
1314
github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
1415
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
@@ -20,7 +21,9 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg
2021
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
2122
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
2223
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
24+
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
2325
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
26+
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
2427
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
2528
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
2629
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
@@ -30,8 +33,11 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k
3033
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
3134
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
3235
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
36+
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
3337
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
38+
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
3439
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
40+
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
3541
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
3642
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
3743
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -45,6 +51,7 @@ github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO
4551
github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI=
4652
github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY=
4753
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
54+
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
4855
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
4956
github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc=
5057
github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU=
@@ -58,6 +65,7 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
5865
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
5966
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
6067
golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
68+
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
6169
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
6270
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
6371
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -74,6 +82,7 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn
7482
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
7583
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
7684
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
85+
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
7786
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
7887
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
7988
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
@@ -87,7 +96,10 @@ google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs
8796
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
8897
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
8998
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
99+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
90100
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
101+
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
91102
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
103+
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
92104
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
93105
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)