Copilot commented on code in PR #1472:
URL: https://github.com/apache/pulsar-client-go/pull/1472#discussion_r2996150368


##########
go.mod:
##########
@@ -50,24 +48,20 @@ require (
        github.com/containerd/log v0.1.0 // indirect
        github.com/containerd/platforms v0.2.1 // indirect
        github.com/cpuguy83/dockercfg v0.3.2 // indirect
-       github.com/danieljoos/wincred v1.1.2 // indirect
        github.com/distribution/reference v0.6.0 // indirect
        github.com/docker/go-units v0.5.0 // indirect
-       github.com/dvsekhvalnov/jose2go v1.7.0 // indirect
        github.com/felixge/httpsnoop v1.0.4 // indirect
        github.com/fsnotify/fsnotify v1.8.0 // indirect
        github.com/fxamacker/cbor/v2 v2.7.0 // indirect
        github.com/go-jose/go-jose/v4 v4.0.5 // indirect
-       github.com/go-logr/logr v1.4.2 // indirect
+       github.com/go-logr/logr v1.4.3 // indirect
        github.com/go-logr/stdr v1.2.2 // indirect
        github.com/go-ole/go-ole v1.2.6 // indirect
-       github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
-       github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
+       github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
        github.com/gogo/protobuf v1.3.2 // indirect

Review Comment:
   The PR description lists `dvsekhvalnov/jose2go: v1.7.0 --> v1.8.0`, but in 
the updated `go.mod`/`go.sum` diffs `jose2go` is removed rather than upgraded 
(and no `v1.8.0` entries appear in `go.sum`). Please either (a) update the PR 
description to reflect that `jose2go` is being removed from the module graph, 
or (b) ensure `jose2go v1.8.0` is actually selected and recorded if it’s still 
required (directly or transitively).



##########
pulsar/producer_test.go:
##########
@@ -2749,6 +2749,14 @@ func (m *mockConn) WriteData(_ context.Context, buffer 
internal.Buffer) {
        m.l.Unlock()
 }
 
+func (m *mockConn) getBuffers() []internal.Buffer {
+       m.l.Lock()
+       defer m.l.Unlock()
+       dst := make([]internal.Buffer, len(m.buffers))
+       copy(dst, m.buffers)
+       return dst
+}

Review Comment:
   `getBuffers()` returns a snapshot copy of the slice, not the underlying live 
buffer list. Renaming to something like `buffersSnapshot()` / `buffersCopy()` 
would better communicate the semantics and reduce the risk of callers assuming 
it stays in sync with the connection state.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to