Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock values are being copied in buffer and clients #23

Closed
mochi-co opened this issue Jan 28, 2022 · 0 comments · Fixed by #24
Closed

Lock values are being copied in buffer and clients #23

mochi-co opened this issue Jan 28, 2022 · 0 comments · Fixed by #24
Assignees
Labels
bug Something isn't working

Comments

@mochi-co
Copy link
Collaborator

go vet reports that lock values are being copied in clients.Inflight and circ.Buffer. Additionally, the signature for the buffer WriteTo is incorrect.

# github.com/mochi-co/mqtt/server
server/server.go:224:18: assignment copies lock value to cl.Inflight: github.com/mochi-co/mqtt/server/internal/clients.Inflight
# github.com/mochi-co/mqtt/server/internal/circ
server/internal/circ/buffer.go:77:9: return copies lock value: github.com/mochi-co/mqtt/server/internal/circ.Buffer contains sync.RWMutex
server/internal/circ/reader.go:18:3: literal copies lock value from b: github.com/mochi-co/mqtt/server/internal/circ.Buffer contains sync.RWMutex
server/internal/circ/reader.go:28:3: literal copies lock value from b: github.com/mochi-co/mqtt/server/internal/circ.Buffer contains sync.RWMutex
server/internal/circ/writer.go:19:3: literal copies lock value from b: github.com/mochi-co/mqtt/server/internal/circ.Buffer contains sync.RWMutex
server/internal/circ/writer.go:29:3: literal copies lock value from b: github.com/mochi-co/mqtt/server/internal/circ.Buffer contains sync.RWMutex
server/internal/circ/pool_test.go:11:20: call of require.NotNil copies lock value: sync.Pool contains sync.noCopy
server/internal/circ/writer.go:34:18: method WriteTo(w io.Writer) (total int, err error) should have signature WriteTo(io.Writer) (int64, error)

The above issues should be corrected.

@mochi-co mochi-co added the bug Something isn't working label Jan 28, 2022
@mochi-co mochi-co self-assigned this Jan 28, 2022
@mochi-co mochi-co linked a pull request Jan 28, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant