Skip to content

Commit 91cd20a

Browse files
authored
Merge pull request #205 from keybase/joshblum/go1.25
go1.25
2 parents 5f9df9a + bc4796d commit 91cd20a

33 files changed

+348
-194
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,53 @@
11
name: CI
2+
23
on:
34
push:
45
branches:
56
- master
67
pull_request:
78
branches:
89
- master
10+
schedule:
11+
# Run daily at 2 AM UTC to check for new vulnerabilities
12+
- cron: "0 2 * * *"
13+
14+
permissions:
15+
contents: read
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
921
jobs:
1022
test:
23+
timeout-minutes: 15
1124
strategy:
1225
matrix:
13-
go-version: [1.21.x, 1.22.x, 1.23.x]
26+
go-version: [1.25.x, 1.24.x]
1427
os: [ubuntu-latest]
1528
runs-on: ${{ matrix.os }}
1629
steps:
17-
- uses: actions/setup-go@v3
30+
- uses: actions/checkout@v6
31+
with:
32+
persist-credentials: false
33+
34+
- uses: actions/setup-go@v6
1835
with:
1936
go-version: ${{ matrix.go-version }}
20-
- uses: actions/checkout@v3
37+
cache: true
38+
2139
- name: golangci-lint
22-
uses: golangci/golangci-lint-action@v3
40+
uses: golangci/golangci-lint-action@v9
41+
with:
42+
version: v2.7.2
43+
44+
- name: Build
45+
run: go build -v ./...
46+
47+
- name: Run govulncheck
48+
uses: golang/govulncheck-action@v1
2349
with:
24-
version: v1.63
25-
- run: go vet ./...
26-
- run: go test -v -race ./...
50+
go-version-input: ${{ matrix.go-version }}
51+
52+
- name: Test
53+
run: go test -race ./...

.golangci.yml

Lines changed: 63 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,66 @@
1-
linters-settings:
2-
gocritic:
3-
disabled-checks:
4-
- ifElseChain
5-
- elseif
1+
version: "2"
2+
3+
run:
4+
timeout: 5m
5+
tests: true
6+
7+
formatters:
8+
enable:
9+
- gofumpt
610

711
linters:
812
enable:
9-
- gofmt
10-
- govet
11-
- gocritic
12-
- unconvert
13-
- revive
13+
# Core recommended linters
14+
- errcheck # Checks for unchecked errors
15+
- govet # Go vet checks
16+
- ineffassign # Detects ineffectual assignments
17+
- staticcheck # Advanced static analysis
18+
- unused # Finds unused code
19+
20+
# Code quality
21+
- misspell # Finds commonly misspelled words
22+
- unconvert # Unnecessary type conversions (already enabled in original)
23+
- unparam # Finds unused function parameters
24+
- gocritic # Various checks (already enabled in original)
25+
- revive # Fast, configurable linter (already enabled in original)
26+
27+
# Security and best practices
28+
- gosec # Security-focused linter
29+
- bodyclose # Checks HTTP response body closed
30+
- noctx # Finds HTTP requests without context
31+
32+
settings:
33+
gocritic:
34+
disabled-checks:
35+
- ifElseChain
36+
- elseif
37+
38+
govet:
39+
enable-all: true
40+
disable:
41+
- shadow
42+
- fieldalignment
43+
44+
revive:
45+
enable-all-rules: false
46+
47+
exclusions:
48+
rules:
49+
# Exclude specific revive rules
50+
- linters:
51+
- revive
52+
text: "package-comments"
53+
54+
- linters:
55+
- revive
56+
text: "exported"
57+
58+
# Exclude specific staticcheck rules
59+
- linters:
60+
- staticcheck
61+
text: "ST1005"
62+
63+
# Exclude specific gocritic rules
64+
- linters:
65+
- gocritic
66+
text: "ifElseChain"

go.mod

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
module github.com/keybase/go-framed-msgpack-rpc
22

3-
go 1.21
3+
go 1.24.0
4+
5+
toolchain go1.25.5
46

57
require (
68
github.com/keybase/backoff v1.0.1-0.20160517061000-726b63b835ec
79
github.com/keybase/go-codec v0.0.0-20180928230036-164397562123
8-
github.com/keybase/msgpackzip v0.0.0-20250106200500-93bf3a4c34cf
10+
github.com/keybase/msgpackzip v0.0.0-20251211192551-92e2da32c96f
911
github.com/reiver/go-telnet v0.0.0-20180421082511-9ff0b2ab096e
10-
github.com/stretchr/testify v1.10.0
11-
golang.org/x/net v0.34.0
12-
golang.org/x/sync v0.10.0
12+
github.com/stretchr/testify v1.11.1
13+
golang.org/x/sync v0.19.0
1314
)
1415

1516
require (
1617
github.com/davecgh/go-spew v1.1.1 // indirect
1718
github.com/pmezard/go-difflib v1.0.0 // indirect
1819
github.com/reiver/go-oi v1.0.0 // indirect
20+
golang.org/x/net v0.48.0 // indirect
1921
gopkg.in/yaml.v3 v3.0.1 // indirect
2022
)

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ github.com/keybase/backoff v1.0.1-0.20160517061000-726b63b835ec h1:D6qL2WCnAuxuc
44
github.com/keybase/backoff v1.0.1-0.20160517061000-726b63b835ec/go.mod h1:jeBKj+20GIDry3doFsAMYH9n7Y3l7ajE3xJrKvVB23s=
55
github.com/keybase/go-codec v0.0.0-20180928230036-164397562123 h1:yg56lYPqh9suJepqxOMd/liFgU/x+maRPiB30JNYykM=
66
github.com/keybase/go-codec v0.0.0-20180928230036-164397562123/go.mod h1:r/eVVWCngg6TsFV/3HuS9sWhDkAzGG8mXhiuYA+Z/20=
7-
github.com/keybase/msgpackzip v0.0.0-20250106200500-93bf3a4c34cf h1:wG5lhAbfl5Gir35gAdJywwf7tEjPW9oI0jBjzQZysxQ=
8-
github.com/keybase/msgpackzip v0.0.0-20250106200500-93bf3a4c34cf/go.mod h1:XGERKRnPD1bFQJrhQp5XHw4JtZ+u3nlgdx/xrwF13ow=
7+
github.com/keybase/msgpackzip v0.0.0-20251211192551-92e2da32c96f h1:UVXvoLUzoklPpid3WlHsm/nnITJCt53dYbKP1/4XHnw=
8+
github.com/keybase/msgpackzip v0.0.0-20251211192551-92e2da32c96f/go.mod h1:fsoZSh32mLpZxN6dpbk+3DiMqMsACDxj7q6ZS381EnQ=
99
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1010
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
1111
github.com/reiver/go-oi v1.0.0 h1:nvECWD7LF+vOs8leNGV/ww+F2iZKf3EYjYZ527turzM=
1212
github.com/reiver/go-oi v1.0.0/go.mod h1:RrDBct90BAhoDTxB1fenZwfykqeGvhI6LsNfStJoEkI=
1313
github.com/reiver/go-telnet v0.0.0-20180421082511-9ff0b2ab096e h1:quuzZLi72kkJjl+f5AQ93FMcadG19WkS7MO6TXFOSas=
1414
github.com/reiver/go-telnet v0.0.0-20180421082511-9ff0b2ab096e/go.mod h1:+5vNVvEWwEIx86DB9Ke/+a5wBI464eDRo3eF0LcfpWg=
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-
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
18-
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
19-
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
20-
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
15+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
16+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
17+
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
18+
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
19+
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
20+
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
2121
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
2222
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2323
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

rpc/call.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package rpc
22

33
import (
4+
"context"
45
"sync"
5-
6-
"golang.org/x/net/context"
76
)
87

98
type call struct {
@@ -35,7 +34,8 @@ func newCallContainer() *callContainer {
3534
}
3635

3736
func (cc *callContainer) NewCall(ctx context.Context, m string, arg interface{}, res interface{},
38-
ctype CompressionType, u ErrorUnwrapper, instrumenter *NetworkInstrumenter) *call {
37+
ctype CompressionType, u ErrorUnwrapper, instrumenter *NetworkInstrumenter,
38+
) *call {
3939
// Buffer one response to take into account that a call stops
4040
// waiting for its result when its canceled. (See
4141
// https://github.com/keybase/go-framed-msgpack-rpc/issues/62

rpc/client.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package rpc
22

33
import (
4+
"context"
45
"errors"
56
"time"
6-
7-
"golang.org/x/net/context"
87
)
98

109
// Client allows calls and notifies on the given transporter, or any protocol
@@ -20,14 +19,16 @@ type Client struct {
2019
// NewClient constructs a new client from the given RPC Transporter and the
2120
// ErrorUnwrapper.
2221
func NewClient(xp Transporter, u ErrorUnwrapper,
23-
tagsFunc LogTagsFromContext) *Client {
22+
tagsFunc LogTagsFromContext,
23+
) *Client {
2424
return &Client{xp, u, tagsFunc, nil}
2525
}
2626

2727
// NewClientWithSendNotifier constructs a new client from the given RPC Transporter, the
2828
// ErrorUnwrapper, and the SendNotifier
2929
func NewClientWithSendNotifier(xp Transporter, u ErrorUnwrapper,
30-
tagsFunc LogTagsFromContext, sendNotifier SendNotifier) *Client {
30+
tagsFunc LogTagsFromContext, sendNotifier SendNotifier,
31+
) *Client {
3132
return &Client{xp, u, tagsFunc, sendNotifier}
3233
}
3334

@@ -52,12 +53,14 @@ func (c *Client) Call(ctx context.Context, method string, arg interface{}, res i
5253
// CallCompressed acts as Call but allows the response to be compressed with
5354
// the given CompressionType.
5455
func (c *Client) CallCompressed(ctx context.Context, method string,
55-
arg interface{}, res interface{}, ctype CompressionType, timeout time.Duration) error {
56+
arg interface{}, res interface{}, ctype CompressionType, timeout time.Duration,
57+
) error {
5658
return c.call(ctx, method, arg, res, ctype, timeout)
5759
}
5860

5961
func (c *Client) call(ctx context.Context, method string,
60-
arg interface{}, res interface{}, ctype CompressionType, timeout time.Duration) error {
62+
arg interface{}, res interface{}, ctype CompressionType, timeout time.Duration,
63+
) error {
6164
if ctx == nil {
6265
return errors.New("No Context provided for this call")
6366
}

rpc/codec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package rpc
22

33
import (
4+
"context"
45
"fmt"
56
"io"
67

78
"github.com/keybase/go-codec/codec"
8-
"golang.org/x/net/context"
99
)
1010

1111
func newCodecMsgpackHandle() codec.Handle {

rpc/compress_gzip.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func (c *gzipCompressor) getGzipWriter(writer io.Writer) (*gzip.Writer, func())
3434
gzipWriterPool.Put(gzipWriter)
3535
}
3636
}
37+
3738
func (c *gzipCompressor) getGzipReader(reader io.Reader) (*gzip.Reader, func(), error) {
3839
gzipReader := gzipReaderPool.Get().(*gzip.Reader)
3940
if err := gzipReader.Reset(reader); err != nil {
@@ -45,7 +46,6 @@ func (c *gzipCompressor) getGzipReader(reader io.Reader) (*gzip.Reader, func(),
4546
}
4647

4748
func (c *gzipCompressor) Compress(data []byte) ([]byte, error) {
48-
4949
var buf bytes.Buffer
5050
writer, reclaim := c.getGzipWriter(&buf)
5151
defer reclaim()
@@ -60,7 +60,6 @@ func (c *gzipCompressor) Compress(data []byte) ([]byte, error) {
6060
}
6161

6262
func (c *gzipCompressor) Decompress(data []byte) ([]byte, error) {
63-
6463
in := bytes.NewReader(data)
6564
reader, reclaim, err := c.getGzipReader(in)
6665
if err != nil {

0 commit comments

Comments
 (0)