From ad4aa91e08fa1091ea4fdf006e9081c36633ac78 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Sun, 17 May 2026 09:50:08 -0500 Subject: [PATCH] minor linting things --- cmd/showbridge/main.go | 2 +- internal/framer/slip.go | 5 +++-- internal/module/tcp-server.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/showbridge/main.go b/cmd/showbridge/main.go index 032d839..eba1764 100644 --- a/cmd/showbridge/main.go +++ b/cmd/showbridge/main.go @@ -159,7 +159,7 @@ func run(ctx context.Context, c *cli.Command) error { return errors.New("config path cannot be empty") } - logLevel := slog.LevelInfo + var logLevel slog.Level logLevelFromFlag := c.String("log-level") diff --git a/internal/framer/slip.go b/internal/framer/slip.go index dffcc7f..fecf12c 100644 --- a/internal/framer/slip.go +++ b/internal/framer/slip.go @@ -25,9 +25,10 @@ func (sf *SlipFramer) Decode(data []byte) [][]byte { } if escapeNext { - if packetByte == ESC_END { + switch packetByte { + case ESC_END: sf.buffer = append(sf.buffer, END) - } else if packetByte == ESC_ESC { + case ESC_ESC: sf.buffer = append(sf.buffer, ESC) } escapeNext = false diff --git a/internal/module/tcp-server.go b/internal/module/tcp-server.go index 27e7e0a..dce1c62 100644 --- a/internal/module/tcp-server.go +++ b/internal/module/tcp-server.go @@ -236,7 +236,7 @@ func (ts *TCPServer) Output(ctx context.Context, payload any) error { for _, connection := range ts.connections { _, err := connection.Write(payloadBytes) if err != nil { - errorString.WriteString(fmt.Sprintf("%s\n", err.Error())) + fmt.Fprintf(&errorString, "%s\n", err.Error()) } } ts.connectionsMu.Unlock()