mirror of
https://github.com/mochi-mqtt/server.git
synced 2025-10-29 10:42:38 +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.
|
// It provides a 'client' to which inline retained messages can be assigned.
|
||||||
func (*inlineMessages) Info() events.Client {
|
func (*inlineMessages) Info() events.Client {
|
||||||
return events.Client{
|
return events.Client{
|
||||||
"inline",
|
ID: "inline",
|
||||||
"inline",
|
Remote: "inline",
|
||||||
"inline",
|
Listener: "inline",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -210,7 +210,11 @@ func BenchmarkServerServe(b *testing.B) {
|
|||||||
|
|
||||||
func TestServerInlineInfo(t *testing.T) {
|
func TestServerInlineInfo(t *testing.T) {
|
||||||
s := New()
|
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) {
|
func TestServerEstablishConnectionOKCleanSession(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user