Skip to content

Commit 87e3b85

Browse files
authored
chore(deps): bump sarama to v1.40.0 (#214)
* chore(deps): bump sarama to v1.40.0 Note: the module path has changed to github.com/IBM/sarama since ownership transitioned away from Shopify * chore(lint): fix issues found in new golangci-lint It looks like the GitHub Action doesn't have a pinned golangci-lint version, so it's pulled in the latest (golangci-lint v1.54.0) which now flags a few additional issues that it didn't previously. Signed-off-by: Dominic Evans <[email protected]> --------- Signed-off-by: Dominic Evans <[email protected]>
1 parent 4541717 commit 87e3b85

File tree

9 files changed

+39
-43
lines changed

9 files changed

+39
-43
lines changed

.golangci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ linters:
1616
- lll
1717
- misspell
1818
- nakedret
19-
- structcheck
2019
- unparam
21-
- varcheck
20+
- unused
2221

2322
linters-settings:
2423
dupl:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ backend asynchronously.
109109
#### Kafka Reporter
110110
High performance Reporter transporting Spans to the Zipkin server using a Kafka
111111
Producer digesting JSON V2 Spans. The reporter uses the
112-
[Sarama async producer](https://godoc.org/github.com/Shopify/sarama#AsyncProducer)
112+
[Sarama async producer](https://pkg.go.dev/github.com/IBM/sarama#AsyncProducer)
113113
underneath.
114114

115115
## usage and examples

go.mod

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
module github.com/openzipkin/zipkin-go
22

3+
go 1.18
4+
35
require (
4-
github.com/Shopify/sarama v1.37.2
6+
github.com/IBM/sarama v1.40.0
57
github.com/onsi/ginkgo v1.16.5
68
github.com/onsi/gomega v1.16.0
79
github.com/rabbitmq/amqp091-go v1.5.0
@@ -12,7 +14,7 @@ require (
1214
require (
1315
github.com/davecgh/go-spew v1.1.1 // indirect
1416
github.com/eapache/go-resiliency v1.3.0 // indirect
15-
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
17+
github.com/eapache/go-xerial-snappy v0.0.0-20230111030713-bf00bc1b83b6 // indirect
1618
github.com/eapache/queue v1.1.0 // indirect
1719
github.com/fsnotify/fsnotify v1.4.9 // indirect
1820
github.com/golang/protobuf v1.5.2 // indirect
@@ -26,19 +28,17 @@ require (
2628
github.com/jcmturner/gofork v1.7.6 // indirect
2729
github.com/jcmturner/gokrb5/v8 v8.4.3 // indirect
2830
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
29-
github.com/klauspost/compress v1.15.11 // indirect
31+
github.com/klauspost/compress v1.15.14 // indirect
3032
github.com/kr/text v0.2.0 // indirect
3133
github.com/nxadm/tail v1.4.8 // indirect
3234
github.com/pierrec/lz4/v4 v4.1.17 // indirect
3335
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
3436
github.com/rogpeppe/go-internal v1.9.0 // indirect
3537
golang.org/x/crypto v0.0.0-20221010152910-d6f0a8c073c2 // indirect
36-
golang.org/x/net v0.0.0-20221004154528-8021a29435af // indirect
37-
golang.org/x/sys v0.0.0-20221010170243-090e33056c14 // indirect
38-
golang.org/x/text v0.3.8 // indirect
38+
golang.org/x/net v0.7.0 // indirect
39+
golang.org/x/sys v0.5.0 // indirect
40+
golang.org/x/text v0.7.0 // indirect
3941
google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e // indirect
4042
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
4143
gopkg.in/yaml.v2 v2.4.0 // indirect
4244
)
43-
44-
go 1.18

go.sum

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
github.com/Shopify/sarama v1.37.2 h1:LoBbU0yJPte0cE5TZCGdlzZRmMgMtZU/XgnUKZg9Cv4=
2-
github.com/Shopify/sarama v1.37.2/go.mod h1:Nxye/E+YPru//Bpaorfhc3JsSGYwCaDDj+R4bK52U5o=
1+
github.com/IBM/sarama v1.40.0 h1:QTVmX+gMKye52mT5x+Ve/Bod2D0Gy7ylE2Wslv+RHtc=
2+
github.com/IBM/sarama v1.40.0/go.mod h1:6pBloAs1WanL/vsq5qFTyTGulJUntZHhMLOUYEIs9mg=
33
github.com/Shopify/toxiproxy/v2 v2.5.0 h1:i4LPT+qrSlKNtQf5QliVjdP08GyAH8+BUIc9gT0eahc=
44
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
55
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
66
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
77
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
88
github.com/eapache/go-resiliency v1.3.0 h1:RRL0nge+cWGlxXbUzJ7yMcq6w2XBEr19dCN6HECGaT0=
99
github.com/eapache/go-resiliency v1.3.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho=
10-
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw=
11-
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
10+
github.com/eapache/go-xerial-snappy v0.0.0-20230111030713-bf00bc1b83b6 h1:8yY/I9ndfrgrXUbOGObLHKBR4Fl3nZXwM2c7OYTT8hM=
11+
github.com/eapache/go-xerial-snappy v0.0.0-20230111030713-bf00bc1b83b6/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0=
1212
github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
1313
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
1414
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
@@ -57,8 +57,8 @@ github.com/jcmturner/gokrb5/v8 v8.4.3 h1:iTonLeSJOn7MVUtyMT+arAn5AKAPrkilzhGw8wE
5757
github.com/jcmturner/gokrb5/v8 v8.4.3/go.mod h1:dqRwJGXznQrzw6cWmyo6kH+E7jksEQG/CyVWsJEsJO0=
5858
github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY=
5959
github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc=
60-
github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c=
61-
github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
60+
github.com/klauspost/compress v1.15.14 h1:i7WCKDToww0wA+9qrUZ1xOjp218vfFo3nTU6UHp+gOc=
61+
github.com/klauspost/compress v1.15.14/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
6262
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
6363
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
6464
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -93,8 +93,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
9393
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
9494
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
9595
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
96-
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
9796
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
97+
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
9898
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
9999
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
100100
go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA=
@@ -119,13 +119,13 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b
119119
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
120120
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
121121
golang.org/x/net v0.0.0-20220725212005-46097bf591d3/go.mod h1:AaygXjzTFtRAg2ttMY5RMuhpJ3cNnI0XpyFJD1iQRSM=
122-
golang.org/x/net v0.0.0-20221004154528-8021a29435af h1:wv66FM3rLZGPdxpYL+ApnDe2HzHcTFta3z5nsc13wI4=
123-
golang.org/x/net v0.0.0-20221004154528-8021a29435af/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
122+
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
123+
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
124124
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
125125
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
126126
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
127127
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
128-
golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7 h1:ZrnxWX62AgTKOSagEqxvb3ffipvEDX2pl7E1TdqLqIc=
128+
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
129129
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
130130
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
131131
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -141,16 +141,16 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w
141141
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
142142
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
143143
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
144-
golang.org/x/sys v0.0.0-20221010170243-090e33056c14 h1:k5II8e6QD8mITdi+okbbmR/cIyEbeXLBhy5Ha4nevyc=
145-
golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
144+
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
145+
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
146146
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
147147
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
148148
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
149149
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
150150
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
151151
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
152-
golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY=
153-
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
152+
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
153+
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
154154
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
155155
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
156156
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=

idgenerator/idgenerator_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,9 @@ func TestRandomTimeStamped(t *testing.T) {
121121

122122
var latestTS uint64
123123
for idx, traceID := range ids {
124-
if new, old := traceID.High>>32, latestTS; new < old {
125-
t.Errorf("[%d] expected a higher timestamp part in traceid but got: old: %d new: %d", idx, old, new)
124+
if newVal, oldVal := traceID.High>>32, latestTS; newVal < oldVal {
125+
t.Errorf("[%d] expected a higher timestamp part in traceid but got: old: %d new: %d", idx, oldVal, newVal)
126126
}
127127
latestTS = traceID.High >> 32
128128
}
129-
130129
}

middleware/http/client.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func NewClient(tracer *zipkin.Tracer, options ...ClientOption) (*Client, error)
108108
}
109109

110110
// DoWithAppSpan wraps http.Client's Do with tracing using an application span.
111-
func (c *Client) DoWithAppSpan(req *http.Request, name string) (res *http.Response, err error) {
111+
func (c *Client) DoWithAppSpan(req *http.Request, name string) (*http.Response, error) {
112112
var parentContext model.SpanContext
113113

114114
if span := zipkin.SpanFromContext(req.Context()); span != nil {
@@ -120,13 +120,13 @@ func (c *Client) DoWithAppSpan(req *http.Request, name string) (res *http.Respon
120120
zipkin.TagHTTPMethod.Set(appSpan, req.Method)
121121
zipkin.TagHTTPPath.Set(appSpan, req.URL.Path)
122122

123-
res, err = c.Client.Do(
123+
res, err := c.Do(
124124
req.WithContext(zipkin.NewContext(req.Context(), appSpan)),
125125
)
126126
if err != nil {
127127
zipkin.TagError.Set(appSpan, err.Error())
128128
appSpan.Finish()
129-
return
129+
return res, err
130130
}
131131

132132
if c.httpTrace {

reporter/amqp/amqp_test.go

+5-9
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,15 @@ func TestRabbitClose(t *testing.T) {
7777
}
7878
}
7979

80-
func setupRabbit(t *testing.T, address string) (conn *amqp.Connection, ch *amqp.Channel, close func()) {
80+
func setupRabbit(t *testing.T, address string) (*amqp.Connection, *amqp.Channel, func()) {
8181
var err error
82-
conn, err = amqp.Dial(address)
82+
conn, err := amqp.Dial(address)
8383
failOnError(t, err, "Failed to connect to RabbitMQ")
8484

85-
ch, err = conn.Channel()
85+
ch, err := conn.Channel()
8686
failOnError(t, err, "Failed to open a channel")
8787

88-
close = func() {
89-
conn.Close()
90-
ch.Close()
91-
}
92-
return
88+
return conn, ch, func() { conn.Close(); ch.Close() }
9389
}
9490

9591
func setupConsume(t *testing.T, ch *amqp.Channel) <-chan amqp.Delivery {
@@ -139,7 +135,7 @@ func testEqual(t *testing.T, want *model.SpanModel, have *model.SpanModel) {
139135

140136
func makeNewSpan(methodName string, traceID, spanID, parentSpanID uint64, debug bool) *model.SpanModel {
141137
timestamp := time.Now()
142-
var parentID = new(model.ID)
138+
parentID := new(model.ID)
143139
if parentSpanID != 0 {
144140
*parentID = model.ID(parentSpanID)
145141
}

reporter/kafka/kafka.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import (
2121
"log"
2222
"os"
2323

24-
"github.com/Shopify/sarama"
24+
"github.com/IBM/sarama"
25+
2526
"github.com/openzipkin/zipkin-go/model"
2627
"github.com/openzipkin/zipkin-go/reporter"
2728
)

reporter/kafka/kafka_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import (
2121
"testing"
2222
"time"
2323

24-
"github.com/Shopify/sarama"
24+
"github.com/IBM/sarama"
25+
2526
"github.com/openzipkin/zipkin-go/model"
2627
zp3 "github.com/openzipkin/zipkin-go/proto/zipkin_proto3"
2728
"github.com/openzipkin/zipkin-go/reporter"
@@ -279,7 +280,7 @@ func testEqual(t *testing.T, want *model.SpanModel, have *model.SpanModel) {
279280

280281
func makeNewSpan(methodName string, traceID, spanID, parentSpanID uint64, debug bool) *model.SpanModel {
281282
timestamp := time.Now()
282-
var parentID = new(model.ID)
283+
parentID := new(model.ID)
283284
if parentSpanID != 0 {
284285
*parentID = model.ID(parentSpanID)
285286
}

0 commit comments

Comments
 (0)