mirror of
https://github.com/mochi-mqtt/server.git
synced 2025-10-28 18:31:46 +08:00
Add Keyed fields to events.Client for readability and go vet
This commit is contained in:
@@ -444,9 +444,9 @@ func (s *Server) Publish(topic string, payload []byte, retain bool) error {
|
||||
// It provides a 'client' to which inline retained messages can be assigned.
|
||||
func (*inlineMessages) Info() events.Client {
|
||||
return events.Client{
|
||||
"inline",
|
||||
"inline",
|
||||
"inline",
|
||||
ID: "inline",
|
||||
Remote: "inline",
|
||||
Listener: "inline",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -210,7 +210,11 @@ func BenchmarkServerServe(b *testing.B) {
|
||||
|
||||
func TestServerInlineInfo(t *testing.T) {
|
||||
s := New()
|
||||
require.Equal(t, events.Client{"inline", "inline", "inline"}, s.inline.Info())
|
||||
require.Equal(t, events.Client{
|
||||
ID: "inline",
|
||||
Remote: "inline",
|
||||
Listener: "inline",
|
||||
}, s.inline.Info())
|
||||
}
|
||||
|
||||
func TestServerEstablishConnectionOKCleanSession(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user