Skip to content

Commit cae99cc

Browse files
committed
Upgrade go version
1 parent 6301dbd commit cae99cc

File tree

10 files changed

+57
-61
lines changed

10 files changed

+57
-61
lines changed

.github/workflows/actions.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ jobs:
1313
name: Lint
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v3
17-
- uses: golangci/golangci-lint-action@v3
16+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
- uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
1818
with:
19-
version: v1.52.2
19+
version: v1.64.8
2020
test:
2121
name: Test
2222
runs-on: ubuntu-latest
2323
strategy:
2424
matrix:
2525
go: [ 'stable', 'oldstable' ]
2626
steps:
27-
- uses: actions/checkout@v3
28-
- uses: actions/setup-go@v3
27+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
2929
with:
3030
go-version: ${{ matrix.go }}
3131
cache: true
3232
- run: go test -race -covermode=atomic -coverprofile=coverage.txt ./...
33-
- uses: codecov/codecov-action@v3
33+
- uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0

.golangci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
linters-settings:
22
errcheck:
3-
check-type-asserts: true
3+
check-type-assertions: true
44
check-blank: true
55
misspell:
66
locale: US
@@ -11,7 +11,7 @@ linters:
1111
- varnamelen
1212
- wsl
1313
- exhaustruct
14-
- exhaustivestruct
14+
- depguard
1515

1616
issues:
1717
exclude-rules:

context.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type (
1414

1515
// RequestID takes request id from context.
1616
func RequestID(c context.Context) *json.RawMessage {
17-
v, _ := c.Value(requestIDKey{}).(*json.RawMessage)
17+
v, _ := c.Value(requestIDKey{}).(*json.RawMessage) //nolint: errcheck
1818

1919
return v
2020
}
@@ -26,7 +26,7 @@ func WithRequestID(c context.Context, id *json.RawMessage) context.Context {
2626

2727
// GetMetadata takes jsonrpc metadata from context.
2828
func GetMetadata(c context.Context) Metadata {
29-
v, _ := c.Value(metadataIDKey{}).(Metadata)
29+
v, _ := c.Value(metadataIDKey{}).(Metadata) //nolint: errcheck
3030

3131
return v
3232
}
@@ -38,7 +38,7 @@ func WithMetadata(c context.Context, md Metadata) context.Context {
3838

3939
// MethodName takes method name from context.
4040
func MethodName(c context.Context) string {
41-
v, _ := c.Value(methodNameKey{}).(string)
41+
v, _ := c.Value(methodNameKey{}).(string) //nolint: errcheck
4242

4343
return v
4444
}

context_test.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package jsonrpc_test
22

33
import (
4-
"context"
54
"testing"
65

76
"github.com/goccy/go-json"
@@ -12,9 +11,8 @@ import (
1211
func TestRequestID(t *testing.T) {
1312
t.Parallel()
1413

15-
c := context.Background()
1614
id := json.RawMessage("1")
17-
c = jsonrpc.WithRequestID(c, &id)
15+
c := jsonrpc.WithRequestID(t.Context(), &id)
1816
var pick *json.RawMessage
1917
require.NotPanics(t, func() {
2018
pick = jsonrpc.RequestID(c)
@@ -25,9 +23,8 @@ func TestRequestID(t *testing.T) {
2523
func TestMetadata(t *testing.T) {
2624
t.Parallel()
2725

28-
c := context.Background()
2926
md := jsonrpc.Metadata{Params: jsonrpc.Metadata{}}
30-
c = jsonrpc.WithMetadata(c, md)
27+
c := jsonrpc.WithMetadata(t.Context(), md)
3128
var pick jsonrpc.Metadata
3229
require.NotPanics(t, func() {
3330
pick = jsonrpc.GetMetadata(c)
@@ -38,8 +35,7 @@ func TestMetadata(t *testing.T) {
3835
func TestMethodName(t *testing.T) {
3936
t.Parallel()
4037

41-
c := context.Background()
42-
c = jsonrpc.WithMethodName(c, t.Name())
38+
c := jsonrpc.WithMethodName(t.Context(), t.Name())
4339
var pick string
4440
require.NotPanics(t, func() {
4541
pick = jsonrpc.MethodName(c)

debug_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package jsonrpc_test
22

33
import (
4-
"context"
54
"net/http"
65
"net/http/httptest"
76
"testing"
@@ -17,7 +16,7 @@ func TestDebugHandler(t *testing.T) {
1716
mr := jsonrpc.NewMethodRepository()
1817

1918
rec := httptest.NewRecorder()
20-
r, err := http.NewRequestWithContext(context.Background(), "", "", nil)
19+
r, err := http.NewRequestWithContext(t.Context(), "", "", nil)
2120
require.NoError(t, err)
2221

2322
mr.ServeDebug(rec, r)
@@ -31,7 +30,7 @@ func TestDebugHandler(t *testing.T) {
3130
}{}))
3231

3332
rec = httptest.NewRecorder()
34-
r, err = http.NewRequestWithContext(context.Background(), "", "", nil)
33+
r, err = http.NewRequestWithContext(t.Context(), "", "", nil)
3534
require.NoError(t, err)
3635

3736
mr.ServeDebug(rec, r)

go.mod

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
module github.com/osamingo/jsonrpc/v2
22

3-
go 1.18
3+
go 1.24
4+
5+
toolchain go1.24.1
46

57
require (
6-
github.com/goccy/go-json v0.10.0
7-
github.com/invopop/jsonschema v0.7.0
8-
github.com/stretchr/testify v1.8.2
8+
github.com/goccy/go-json v0.10.5
9+
github.com/invopop/jsonschema v0.13.0
10+
github.com/stretchr/testify v1.10.0
911
)
1012

1113
require (
14+
github.com/bahlo/generic-list-go v0.2.0 // indirect
15+
github.com/buger/jsonparser v1.1.1 // indirect
1216
github.com/davecgh/go-spew v1.1.1 // indirect
13-
github.com/iancoleman/orderedmap v0.1.0 // indirect
17+
github.com/mailru/easyjson v0.9.0 // indirect
1418
github.com/pmezard/go-difflib v1.0.0 // indirect
19+
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
1520
gopkg.in/yaml.v3 v3.0.1 // indirect
1621
)

go.sum

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
1-
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1+
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
2+
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
3+
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
4+
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
25
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
36
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4-
github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA=
5-
github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
6-
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA=
7-
github.com/iancoleman/orderedmap v0.1.0 h1:2orAxZBJsvimgEBmMWfXaFlzSG2fbQil5qzP3F6cCkg=
8-
github.com/iancoleman/orderedmap v0.1.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA=
9-
github.com/invopop/jsonschema v0.7.0 h1:2vgQcBz1n256N+FpX3Jq7Y17AjYt46Ig3zIWyy770So=
10-
github.com/invopop/jsonschema v0.7.0/go.mod h1:O9uiLokuu0+MGFlyiaqtWxwqJm41/+8Nj0lD7A36YH0=
7+
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
8+
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
9+
github.com/invopop/jsonschema v0.13.0 h1:KvpoAJWEjR3uD9Kbm2HWJmqsEaHt8lBUpd0qHcIi21E=
10+
github.com/invopop/jsonschema v0.13.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0=
11+
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
12+
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
1113
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1214
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
13-
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
14-
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
15-
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
16-
github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
17-
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
18-
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
19-
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
20-
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
15+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
16+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
17+
github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc=
18+
github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw=
2119
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
2220
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
23-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2421
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
2522
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

handler_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestHandler(t *testing.T) {
1919
mr := jsonrpc.NewMethodRepository()
2020

2121
rec := httptest.NewRecorder()
22-
r, err := http.NewRequestWithContext(context.Background(), "", "", nil)
22+
r, err := http.NewRequestWithContext(t.Context(), "", "", nil)
2323
require.NoError(t, err)
2424

2525
mr.ServeHTTP(rec, r)
@@ -30,7 +30,7 @@ func TestHandler(t *testing.T) {
3030
assert.NotNil(t, res.Error)
3131

3232
rec = httptest.NewRecorder()
33-
r, err = http.NewRequestWithContext(context.Background(), "", "", bytes.NewReader([]byte(`{"jsonrpc":"2.0","id":"test","method":"hello","params":{}}`)))
33+
r, err = http.NewRequestWithContext(t.Context(), "", "", bytes.NewReader([]byte(`{"jsonrpc":"2.0","id":"test","method":"hello","params":{}}`)))
3434
require.NoError(t, err)
3535
r.Header.Set("Content-Type", "application/json")
3636

@@ -40,17 +40,17 @@ func TestHandler(t *testing.T) {
4040
require.NoError(t, err)
4141
assert.NotNil(t, res.Error)
4242

43-
h1 := jsonrpc.HandlerFunc(func(c context.Context, params *json.RawMessage) (any, *jsonrpc.Error) {
43+
h1 := jsonrpc.HandlerFunc(func(_ context.Context, _ *json.RawMessage) (any, *jsonrpc.Error) {
4444
return "hello", nil
4545
})
4646
require.NoError(t, mr.RegisterMethod("hello", h1, nil, nil))
47-
h2 := jsonrpc.HandlerFunc(func(c context.Context, params *json.RawMessage) (any, *jsonrpc.Error) {
47+
h2 := jsonrpc.HandlerFunc(func(_ context.Context, _ *json.RawMessage) (any, *jsonrpc.Error) {
4848
return nil, jsonrpc.ErrInternal()
4949
})
5050
require.NoError(t, mr.RegisterMethod("bye", h2, nil, nil))
5151

5252
rec = httptest.NewRecorder()
53-
r, err = http.NewRequestWithContext(context.Background(), "", "", bytes.NewReader([]byte(`{"jsonrpc":"2.0","id":"test","method":"hello","params":{}}`)))
53+
r, err = http.NewRequestWithContext(t.Context(), "", "", bytes.NewReader([]byte(`{"jsonrpc":"2.0","id":"test","method":"hello","params":{}}`)))
5454
require.NoError(t, err)
5555
r.Header.Set("Content-Type", "application/json")
5656

@@ -62,7 +62,7 @@ func TestHandler(t *testing.T) {
6262
assert.Equal(t, "hello", res.Result)
6363

6464
rec = httptest.NewRecorder()
65-
r, err = http.NewRequestWithContext(context.Background(), "", "", bytes.NewReader([]byte(`{"jsonrpc":"2.0","id":"test","method":"bye","params":{}}`)))
65+
r, err = http.NewRequestWithContext(t.Context(), "", "", bytes.NewReader([]byte(`{"jsonrpc":"2.0","id":"test","method":"bye","params":{}}`)))
6666
require.NoError(t, err)
6767
r.Header.Set("Content-Type", "application/json")
6868

jsonrpc_test.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package jsonrpc_test
22

33
import (
44
"bytes"
5-
"context"
65
"net/http"
76
"net/http/httptest"
87
"testing"
@@ -16,7 +15,7 @@ import (
1615
func TestParseRequest(t *testing.T) {
1716
t.Parallel()
1817

19-
r, rerr := http.NewRequestWithContext(context.Background(), "", "", bytes.NewReader(nil))
18+
r, rerr := http.NewRequestWithContext(t.Context(), "", "", bytes.NewReader(nil))
2019
require.NoError(t, rerr)
2120

2221
_, _, err := jsonrpc.ParseRequest(r)
@@ -28,23 +27,23 @@ func TestParseRequest(t *testing.T) {
2827
require.IsType(t, &jsonrpc.Error{}, err)
2928
assert.Equal(t, jsonrpc.ErrorCodeInvalidRequest, err.Code)
3029

31-
r, rerr = http.NewRequestWithContext(context.Background(), "", "", bytes.NewReader([]byte("")))
30+
r, rerr = http.NewRequestWithContext(t.Context(), "", "", bytes.NewReader([]byte("")))
3231
require.NoError(t, rerr)
3332

3433
r.Header.Set("Content-Type", "application/json")
3534
_, _, err = jsonrpc.ParseRequest(r)
3635
require.IsType(t, &jsonrpc.Error{}, err)
3736
assert.Equal(t, jsonrpc.ErrorCodeInvalidRequest, err.Code)
3837

39-
r, rerr = http.NewRequestWithContext(context.Background(), "", "", bytes.NewReader([]byte("test")))
38+
r, rerr = http.NewRequestWithContext(t.Context(), "", "", bytes.NewReader([]byte("test")))
4039
require.NoError(t, rerr)
4140

4241
r.Header.Set("Content-Type", "application/json")
4342
_, _, err = jsonrpc.ParseRequest(r)
4443
require.IsType(t, &jsonrpc.Error{}, err)
4544
assert.Equal(t, jsonrpc.ErrorCodeParse, err.Code)
4645

47-
r, rerr = http.NewRequestWithContext(context.Background(), "", "", bytes.NewReader([]byte("{}")))
46+
r, rerr = http.NewRequestWithContext(t.Context(), "", "", bytes.NewReader([]byte("{}")))
4847
require.NoError(t, rerr)
4948

5049
r.Header.Set("Content-Type", "application/json")
@@ -53,23 +52,23 @@ func TestParseRequest(t *testing.T) {
5352
require.NotEmpty(t, rs)
5453
assert.False(t, batch)
5554

56-
r, rerr = http.NewRequestWithContext(context.Background(), "", "", bytes.NewReader([]byte("[")))
55+
r, rerr = http.NewRequestWithContext(t.Context(), "", "", bytes.NewReader([]byte("[")))
5756
require.NoError(t, rerr)
5857

5958
r.Header.Set("Content-Type", "application/json")
6059
_, _, err = jsonrpc.ParseRequest(r)
6160
require.IsType(t, &jsonrpc.Error{}, err)
6261
assert.Equal(t, jsonrpc.ErrorCodeParse, err.Code)
6362

64-
r, rerr = http.NewRequestWithContext(context.Background(), "", "", bytes.NewReader([]byte("[test]")))
63+
r, rerr = http.NewRequestWithContext(t.Context(), "", "", bytes.NewReader([]byte("[test]")))
6564
require.NoError(t, rerr)
6665

6766
r.Header.Set("Content-Type", "application/json")
6867
_, _, err = jsonrpc.ParseRequest(r)
6968
require.IsType(t, &jsonrpc.Error{}, err)
7069
assert.Equal(t, jsonrpc.ErrorCodeParse, err.Code)
7170

72-
r, rerr = http.NewRequestWithContext(context.Background(), "", "", bytes.NewReader([]byte("[{}]")))
71+
r, rerr = http.NewRequestWithContext(t.Context(), "", "", bytes.NewReader([]byte("[{}]")))
7372
require.NoError(t, rerr)
7473

7574
r.Header.Set("Content-Type", "application/json")
@@ -113,18 +112,18 @@ func TestSendResponse(t *testing.T) {
113112
rec = httptest.NewRecorder()
114113
err = jsonrpc.SendResponse(rec, []*jsonrpc.Response{r}, false)
115114
require.NoError(t, err)
116-
assert.Equal(t, `{"jsonrpc":"2.0","result":{"name":"john"},"id":"test"}
115+
assert.JSONEq(t, `{"jsonrpc":"2.0","result":{"name":"john"},"id":"test"}
117116
`, rec.Body.String())
118117

119118
rec = httptest.NewRecorder()
120119
err = jsonrpc.SendResponse(rec, []*jsonrpc.Response{r}, true)
121120
require.NoError(t, err)
122-
assert.Equal(t, `[{"jsonrpc":"2.0","result":{"name":"john"},"id":"test"}]
121+
assert.JSONEq(t, `[{"jsonrpc":"2.0","result":{"name":"john"},"id":"test"}]
123122
`, rec.Body.String())
124123

125124
rec = httptest.NewRecorder()
126125
err = jsonrpc.SendResponse(rec, []*jsonrpc.Response{r, r}, false)
127126
require.NoError(t, err)
128-
assert.Equal(t, `[{"jsonrpc":"2.0","result":{"name":"john"},"id":"test"},{"jsonrpc":"2.0","result":{"name":"john"},"id":"test"}]
127+
assert.JSONEq(t, `[{"jsonrpc":"2.0","result":{"name":"john"},"id":"test"},{"jsonrpc":"2.0","result":{"name":"john"},"id":"test"}]
129128
`, rec.Body.String())
130129
}

method_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func TestMethods(t *testing.T) {
6666
}
6767

6868
func SampleHandler() *jsonrpc.HandlerFunc {
69-
h := jsonrpc.HandlerFunc(func(c context.Context, params *json.RawMessage) (any, *jsonrpc.Error) {
69+
h := jsonrpc.HandlerFunc(func(_ context.Context, _ *json.RawMessage) (any, *jsonrpc.Error) {
7070
return (any)(nil), nil
7171
})
7272

0 commit comments

Comments
 (0)