From 60746f8824cb2583a9f6c7093e2e233a24b2f70a Mon Sep 17 00:00:00 2001 From: nightnoryu Date: Fri, 24 Oct 2025 13:31:04 +0300 Subject: [PATCH] Fix linter warnings --- pkg/infrastructure/telegram/handler/anonymousmessages.go | 6 +++--- pkg/infrastructure/telegram/middleware/loggingmiddleware.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/infrastructure/telegram/handler/anonymousmessages.go b/pkg/infrastructure/telegram/handler/anonymousmessages.go index 37706ab..b3d5a91 100644 --- a/pkg/infrastructure/telegram/handler/anonymousmessages.go +++ b/pkg/infrastructure/telegram/handler/anonymousmessages.go @@ -10,19 +10,19 @@ import ( "github.com/go-telegram/bot/models" ) -func NewAnonymousMessagesHandler(logger jsonlog.Logger, ownerChatId int) bot.HandlerFunc { +func NewAnonymousMessagesHandler(logger jsonlog.Logger, ownerChatID int) bot.HandlerFunc { return func(ctx context.Context, b *bot.Bot, update *models.Update) { if update.Message == nil { return } - if ownerChatId == 0 { + if ownerChatID == 0 { logger.Info(fmt.Sprintf("owner chat ID not set. set to %d to use the last chat", update.Message.Chat.ID)) return } params := &bot.CopyMessageParams{ - ChatID: ownerChatId, + ChatID: ownerChatID, FromChatID: update.Message.Chat.ID, MessageID: update.Message.ID, } diff --git a/pkg/infrastructure/telegram/middleware/loggingmiddleware.go b/pkg/infrastructure/telegram/middleware/loggingmiddleware.go index 1eac382..54869fc 100644 --- a/pkg/infrastructure/telegram/middleware/loggingmiddleware.go +++ b/pkg/infrastructure/telegram/middleware/loggingmiddleware.go @@ -27,7 +27,7 @@ func NewLoggingMiddleware(logger jsonlog.Logger) bot.Middleware { WithField(usernameField, update.Message.From.Username) text := update.Message.Text - if len(update.Message.Caption) > 0 { + if update.Message.Caption != "" { text = update.Message.Caption }