From 77bddef81214d9e306c360a5a5260691c27373ce Mon Sep 17 00:00:00 2001 From: eleksir Date: Mon, 30 Mar 2026 16:48:15 +0300 Subject: [PATCH] Fix minor bugs: log file close, typo, JSON field consistency - Add defer logfile.Close() to prevent file descriptor leak - Fix typo 'Incomming' -> 'Incoming' in log message - Change JSON tag 'Misc' to 'misc' for consistency with sMsg --- cmd/aleesa-misc-go/main.go | 2 ++ internal/misc/msgParser.go | 2 +- internal/misc/types.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/aleesa-misc-go/main.go b/cmd/aleesa-misc-go/main.go index 9afac62..d97168d 100644 --- a/cmd/aleesa-misc-go/main.go +++ b/cmd/aleesa-misc-go/main.go @@ -28,6 +28,8 @@ func main() { log.Error(fmt.Sprintf("Unable to open log file %s: %s", misc.Config.Log, err)) os.Exit(1) } + + defer logfile.Close() } else { logfile = os.Stderr } diff --git a/internal/misc/msgParser.go b/internal/misc/msgParser.go index 80a36bc..47358d2 100644 --- a/internal/misc/msgParser.go +++ b/internal/misc/msgParser.go @@ -21,7 +21,7 @@ func MsgParser(ctx context.Context, msg string) { j rMsg ) - log.Debugf("Incomming raw json: %s", msg) + log.Debugf("Incoming raw json: %s", msg) if err := json.Unmarshal([]byte(msg), &j); err != nil { log.Warnf("Unable to to parse message from redis channel: %s", err) diff --git a/internal/misc/types.go b/internal/misc/types.go index 903841a..a0cbf58 100644 --- a/internal/misc/types.go +++ b/internal/misc/types.go @@ -56,7 +56,7 @@ type rMsg struct { GoodMorning int64 `json:"good_morning,omitempty"` Msgformat int64 `json:"msg_format,omitempty"` Username string `json:"username,omitempty"` - } `json:"Misc"` + } `json:"misc"` } /* vim: set ft=go noet ai ts=4 sw=4 sts=4: */