Skip to content

Commit 5357683

Browse files
authored
Merge pull request #41 from strvcom/chore/update
chore: update dependencies
2 parents c9f3c99 + 8d2f617 commit 5357683

File tree

17 files changed

+222
-157
lines changed

17 files changed

+222
-157
lines changed

.github/actions/setup-go/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ inputs:
1111
runs:
1212
using: "composite"
1313
steps:
14+
- name: Get Go version
15+
id: go-version
16+
shell: bash
17+
run: echo "go-version=$(sed -ne '/^toolchain /s/^toolchain go//p' go.mod)" >> $GITHUB_OUTPUT
1418
- id: go-setup
1519
uses: actions/setup-go@v5
1620
with:
17-
go-version-file: go.mod
21+
go-version: ${{ steps.go-version.outputs.go-version }}
1822
check-latest: true
1923
cache: ${{ inputs.cache }}

.github/workflows/lint.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
lint:
1313
name: Lint
1414
runs-on: ubuntu-latest
15-
continue-on-error: true
1615
permissions:
1716
contents: read
1817
steps:
@@ -21,6 +20,7 @@ jobs:
2120
- name: Install Go
2221
uses: ./.github/actions/setup-go
2322
- name: Run golangci-lint
24-
uses: golangci/golangci-lint-action@v6
23+
uses: golangci/golangci-lint-action@v7
2524
with:
26-
version: v1.62.0
25+
version: v2.4.0
26+

.github/workflows/vuln-scan.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,9 @@ jobs:
1919
uses: actions/checkout@v4
2020
- name: Install Go
2121
uses: ./.github/actions/setup-go
22-
- name: Install govulncheck
23-
run: |
24-
go install golang.org/x/vuln/cmd/govulncheck@latest
25-
- name: Run govulncheck
26-
run: |
27-
govulncheck ./...
2822
- name: Install OSV Scanner
2923
run: |
30-
go install github.com/google/osv-scanner/cmd/osv-scanner@v1
24+
go install github.com/google/osv-scanner/v2/cmd/osv-scanner@latest
3125
- name: Run OSV Scanner
3226
run: |
3327
osv-scanner -r .

.golangci.yml

Lines changed: 130 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,153 @@
1+
version: "2"
2+
run:
3+
timeout: 3m
14
linters:
2-
# Disable all linters.
3-
# Default: false
4-
disable-all: true
5-
# Enable specific linter
6-
# https://golangci-lint.run/usage/linters/#enabled-by-default-linters
75
enable:
8-
# default linters
9-
- errcheck
10-
- gosimple
11-
- govet
12-
- ineffassign
13-
- staticcheck
14-
- typecheck
15-
- unused
16-
# extra linters
6+
- asasalint
7+
- asciicheck
178
- bidichk
189
- bodyclose
10+
- canonicalheader
11+
- copyloopvar
12+
- dogsled
13+
- dupl
1914
- durationcheck
15+
- errcheck
2016
- errname
2117
- errorlint
2218
- exhaustive
19+
- exptostd
20+
- fatcontext
21+
- forbidigo
22+
- funcorder
23+
- funlen
24+
- gocheckcompilerdirectives
25+
- gochecksumtype
2326
- gocognit
2427
- goconst
2528
- gocritic
26-
- gofmt
27-
- mnd
29+
- gocyclo
30+
- gomoddirectives
31+
- goprintffuncname
2832
- gosec
33+
- gosmopolitan
34+
- govet
35+
- iface
36+
- ineffassign
37+
- importas
38+
- inamedparam
39+
- intrange
40+
- loggercheck
41+
- maintidx
42+
- makezero
43+
- mirror
2944
- misspell
45+
- mnd
46+
- musttag
47+
- nakedret
48+
- nestif
3049
- nilerr
31-
- revive
50+
- nilnesserr
51+
- noctx
52+
- nolintlint
53+
- nosprintfhostport
54+
- perfsprint
3255
- prealloc
33-
- stylecheck
34-
- tenv
56+
- predeclared
57+
- reassign
58+
- revive
59+
- rowserrcheck
60+
- sloglint
61+
- spancheck
62+
- sqlclosecheck
63+
- staticcheck
64+
- testableexamples
65+
- testifylint
3566
- thelper
3667
- tparallel
3768
- unconvert
3869
- unparam
70+
- unused
3971
- usestdlibvars
72+
- usetesting
4073
- wastedassign
4174
- whitespace
42-
43-
linters-settings:
44-
gomnd:
45-
ignored-functions:
46-
- 'strconv.Parse*'
47-
- 'strconv.Format*'
48-
- 'strings.SplitN'
49-
goconst:
50-
ignore-tests: true
51-
gocognit:
52-
min-complexity: 20
53-
revive:
75+
# disabled
76+
#- containedctx
77+
#- contextcheck
78+
#- decorder
79+
#- depguard
80+
#- dupword
81+
#- err113
82+
#- errchkjson
83+
#- exhaustruct
84+
#- forcetypeassert
85+
#- ginkgolinter
86+
#- gochecknoglobals
87+
#- gochecknoinits
88+
#- godot
89+
#- godox
90+
#- goheader
91+
#- gomodguard
92+
#- grouper
93+
#- interfacebloat
94+
#- ireturn
95+
#- lll
96+
#- nilnil
97+
#- nlreturn
98+
#- nonamedreturns
99+
#- paralleltest
100+
#- promlinter
101+
#- protogetter
102+
#- recvcheck
103+
#- tagalign
104+
#- tagliatelle
105+
#- testpackage
106+
#- varnamelen
107+
#- wrapcheck
108+
#- wsl
109+
#- zerologlint
110+
settings:
111+
gocognit:
112+
min-complexity: 20
113+
gocyclo:
114+
min-complexity: 20
115+
inamedparam:
116+
skip-single-param: true
117+
mnd:
118+
ignored-functions:
119+
- os.Chmod
120+
- os.Mkdir.*
121+
- os.OpenFile
122+
- os.WriteFile
123+
- strconv.Parse*
124+
- strconv.Format*
125+
- strings.SplitN
126+
nakedret:
127+
max-func-lines: 0
128+
exclusions:
129+
generated: lax
130+
presets:
131+
- comments
132+
- common-false-positives
133+
- legacy
134+
- std-error-handling
54135
rules:
55-
- name: atomic
56-
severity: warning
57-
disabled: false
58-
- name: context-keys-type
59-
severity: warning
60-
disabled: false
61-
- name: defer
62-
severity: warning
63-
disabled: false
64-
- name: early-return
65-
severity: warning
66-
disabled: false
67-
- name: indent-error-flow
68-
severity: warning
69-
disabled: false
70-
- name: range-val-in-closure
71-
severity: warning
72-
disabled: false
73-
- name: range-val-address
74-
severity: warning
75-
disabled: false
76-
- name: string-of-int
77-
severity: warning
78-
disabled: false
79-
- name: superfluous-else
80-
severity: warning
81-
disabled: false
82-
- name: time-equal
83-
severity: warning
84-
disabled: false
85-
- name: unhandled-error
86-
severity: warning
87-
disabled: false
136+
# Unit tests.
137+
- path: (.+)_test\.go
138+
linters:
139+
- gosec
140+
- funlen
141+
formatters:
142+
enable:
143+
- gci
144+
- gofmt
145+
settings:
146+
gci:
147+
sections:
148+
- standard
149+
- default
150+
- prefix(go.strv.io)
151+
custom-order: true
152+
exclusions:
153+
generated: lax

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @TomasKocman @bafko @Fazt01 @xburda4
1+
* @TomasKocman @bafko @xburda4

go.mod

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
module go.strv.io/net
22

3-
go 1.23.3
3+
go 1.23.0
4+
5+
toolchain go1.25.0
46

57
require (
6-
github.com/99designs/gqlgen v0.17.56
7-
github.com/go-chi/chi/v5 v5.1.0
8+
github.com/99designs/gqlgen v0.17.78
9+
github.com/go-chi/chi/v5 v5.2.2
810
github.com/google/uuid v1.6.0
9-
github.com/stretchr/testify v1.9.0
10-
github.com/vektah/gqlparser/v2 v2.5.19
11-
go.strv.io/time v0.2.1
11+
github.com/stretchr/testify v1.10.0
12+
github.com/vektah/gqlparser/v2 v2.5.30
13+
go.strv.io/time v0.2.2
1214
)
1315

1416
require (
15-
github.com/agnivade/levenshtein v1.1.1 // indirect
17+
github.com/agnivade/levenshtein v1.2.1 // indirect
1618
github.com/davecgh/go-spew v1.1.1 // indirect
1719
github.com/kr/pretty v0.3.1 // indirect
1820
github.com/pmezard/go-difflib v1.0.0 // indirect

go.sum

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
github.com/99designs/gqlgen v0.17.56 h1:+J42ARAHvnysH6klO9Wq+tCsGF32cpAgU3SyF0VRJtI=
2-
github.com/99designs/gqlgen v0.17.56/go.mod h1:rmB6vLvtL8uf9F9w0/irJ5alBkD8DJvj35ET31BKbtY=
3-
github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8=
4-
github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo=
1+
github.com/99designs/gqlgen v0.17.78 h1:bhIi7ynrc3js2O8wu1sMQj1YHPENDt3jQGyifoBvoVI=
2+
github.com/99designs/gqlgen v0.17.78/go.mod h1:yI/o31IauG2kX0IsskM4R894OCCG1jXJORhtLQqB7Oc=
3+
github.com/agnivade/levenshtein v1.2.1 h1:EHBY3UOn1gwdy/VbFwgo4cxecRznFk7fKWN1KOX7eoM=
4+
github.com/agnivade/levenshtein v1.2.1/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU=
55
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
66
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
77
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q=
88
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE=
99
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
1010
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
1111
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
12-
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g=
13-
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
14-
github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw=
15-
github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
12+
github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54 h1:SG7nF6SRlWhcT7cNTs5R6Hk4V2lcmLz2NsG2VnInyNo=
13+
github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
14+
github.com/go-chi/chi/v5 v5.2.2 h1:CMwsvRVTbXVytCk1Wd72Zy1LAsAh9GxMmSNWLHCG618=
15+
github.com/go-chi/chi/v5 v5.2.2/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
1616
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
1717
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
1818
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
@@ -32,12 +32,12 @@ github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
3232
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
3333
github.com/sosodev/duration v1.3.1 h1:qtHBDMQ6lvMQsL15g4aopM4HEfOaYuhWBw3NPTtlqq4=
3434
github.com/sosodev/duration v1.3.1/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg=
35-
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
36-
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
37-
github.com/vektah/gqlparser/v2 v2.5.19 h1:bhCPCX1D4WWzCDvkPl4+TP1N8/kLrWnp43egplt7iSg=
38-
github.com/vektah/gqlparser/v2 v2.5.19/go.mod h1:y7kvl5bBlDeuWIvLtA9849ncyvx6/lj06RsMrEjVy3U=
39-
go.strv.io/time v0.2.1 h1:obREp9amvObE2dLpdXByMIz0TaZeBDODvSSV5u0szgo=
40-
go.strv.io/time v0.2.1/go.mod h1:+719M6ltN7ON7qC7Ieb1FLyrBcdEWu8Z/czdtB3kZ98=
35+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
36+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
37+
github.com/vektah/gqlparser/v2 v2.5.30 h1:EqLwGAFLIzt1wpx1IPpY67DwUujF1OfzgEyDsLrN6kE=
38+
github.com/vektah/gqlparser/v2 v2.5.30/go.mod h1:D1/VCZtV3LPnQrcPBeR/q5jkSQIPti0uYCP/RI0gIeo=
39+
go.strv.io/time v0.2.2 h1:DjcKzVXSd3f+MNV309w7DwP7DL0o8teQyCwpCC11n44=
40+
go.strv.io/time v0.2.2/go.mod h1:jE1ulw4Y5a3m5+pQXKmM+WhfzXuebv189qZJhRMvQCA=
4141
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
4242
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
4343
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

graphql/extension/extension.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func checkRecursionLimitByTypeAndField(rCtx recursionContext, typeName string, s
7070
if err != nil {
7171
return err
7272
}
73-
rCtx.typeAndFieldCount[nesting] -= 1
73+
rCtx.typeAndFieldCount[nesting]--
7474
}
7575

7676
return nil

graphql/extension/extension_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ func (e executableSchema) Schema() *ast.Schema {
8080
return parsedSchema
8181
}
8282

83-
func (e executableSchema) Complexity(_, _ string, _ int, _ map[string]interface{}) (int, bool) {
83+
func (e executableSchema) Complexity(_ context.Context, _, _ string, _ int, _ map[string]any) (int, bool) {
8484
return 0, false
8585
}
8686

8787
func (e executableSchema) Exec(_ context.Context) graphql.ResponseHandler {
88-
return func(ctx context.Context) *graphql.Response {
88+
return func(_ context.Context) *graphql.Response {
8989
return &graphql.Response{}
9090
}
9191
}

http/middleware.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ func LoggingMiddleware(l *slog.Logger) func(http.Handler) http.Handler {
119119
}
120120

121121
if statusCode >= http.StatusInternalServerError {
122-
withRequestData(l, rw, ld).Error("request processed")
122+
withRequestData(l, rw, ld).ErrorContext(r.Context(), "request processed")
123123
} else {
124-
withRequestData(l, rw, ld).Info("request processed")
124+
withRequestData(l, rw, ld).InfoContext(r.Context(), "request processed")
125125
}
126126
})
127127
}

0 commit comments

Comments
 (0)