From 7b6fdbb18aea161c1d3de41e7be783b34df5d5ef Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Tue, 29 Nov 2022 16:25:16 +0100 Subject: [PATCH] Attach ClientHandler methods to references --- cmd/clientsim/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/clientsim/main.go b/cmd/clientsim/main.go index a446ce8..5249405 100644 --- a/cmd/clientsim/main.go +++ b/cmd/clientsim/main.go @@ -187,7 +187,7 @@ type ClientHandler struct { logger *logrus.Logger } -func (c ClientHandler) Send(command *protocol.Command, out chan []byte) error { +func (c *ClientHandler) Send(command *protocol.Command, out chan []byte) error { var ( frame []byte err error @@ -216,7 +216,7 @@ func (c ClientHandler) Send(command *protocol.Command, out chan []byte) error { return nil } -func (c ClientHandler) ResponseAnnounce(in chan []byte) (*protocol.Response, error) { +func (c *ClientHandler) ResponseAnnounce(in chan []byte) (*protocol.Response, error) { response := &protocol.Response{} var announce messages.ResponseAnnounce @@ -237,7 +237,7 @@ func (c ClientHandler) ResponseAnnounce(in chan []byte) (*protocol.Response, err } } -func (c ClientHandler) ResponseData(in chan []byte, response *protocol.Response) error { +func (c *ClientHandler) ResponseData(in chan []byte, response *protocol.Response) error { select { case frame := <-in: switch response.Announce.Code { @@ -265,7 +265,7 @@ func (c ClientHandler) ResponseData(in chan []byte, response *protocol.Response) return nil } -func (c ClientHandler) HandleResponse(response *protocol.Response) error { +func (c *ClientHandler) HandleResponse(response *protocol.Response) error { c.logger.WithField("response", response.Announce).Info("handled response") c.logger.WithField("response", response).Debug("full response")