Add Keyed fields to events.Client for readability and go vet

This commit is contained in:
mochi
2022-03-15 18:44:49 +00:00
parent 325d44d478
commit d6a92cc5bd
2 changed files with 8 additions and 4 deletions

View File

@@ -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",
}
}

View File

@@ -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) {