style: 合入后修 gofmt/govet 与 RegistrationView 类型检查

This commit is contained in:
Nixevol
2026-09-30 16:34:33 +08:00
parent 8f2ebc7d21
commit 0c9b459fb1
18 changed files with 74 additions and 79 deletions
+6 -6
View File
@@ -80,8 +80,8 @@ func (c *Client) connectSubscribeHello(password string, timeout time.Duration) e
if err != nil {
return err
}
if err := c.mc.Send(pkt); err != nil {
return fmt.Errorf("%s CONNECT: %w", c.ID, err)
if sendErr := c.mc.Send(pkt); sendErr != nil {
return fmt.Errorf("%s CONNECT: %w", c.ID, sendErr)
}
ack, err := c.mc.Recv()
if err != nil {
@@ -99,11 +99,11 @@ func (c *Client) connectSubscribeHello(password string, timeout time.Duration) e
if err != nil {
return err
}
if err := c.mc.Send(sub); err != nil {
return fmt.Errorf("%s SUBSCRIBE: %w", c.ID, err)
if sendErr := c.mc.Send(sub); sendErr != nil {
return fmt.Errorf("%s SUBSCRIBE: %w", c.ID, sendErr)
}
if _, err := c.mc.Recv(); err != nil {
return fmt.Errorf("%s SUBACK: %w", c.ID, err)
if _, recvErr := c.mc.Recv(); recvErr != nil {
return fmt.Errorf("%s SUBACK: %w", c.ID, recvErr)
}
hello := protocol.Hello{V: protocol.Version, Type: protocol.TypeHello, RID: "h0", Client: "mqttbench/0.1"}