Skip to content

Commit 876cdb7

Browse files
committed
feat: update go
1 parent 9d1ce84 commit 876cdb7

File tree

6 files changed

+188
-76
lines changed

6 files changed

+188
-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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m
6262
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
6363
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
6464
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
65+
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
6566
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
6667
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
6768
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
@@ -120,6 +121,7 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
120121
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
121122
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
122123
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
124+
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
123125
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
124126
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
125127
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@@ -168,8 +170,11 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY
168170
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
169171
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
170172
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
173+
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
171174
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
175+
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
172176
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
177+
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
173178
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
174179
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
175180
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@@ -499,6 +504,7 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogR
499504
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
500505
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
501506
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
507+
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
502508
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
503509
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
504510
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

0 commit comments

Comments
 (0)