From f4b46246ebb40f3272405e3e589f6f922165ee59 Mon Sep 17 00:00:00 2001 From: Aleksandr Bortnikov Date: Sun, 8 Mar 2026 15:28:18 +0300 Subject: [PATCH] fix: tests and linter issues --- pkg/channels/telegram/telegram.go | 7 ++++++- pkg/channels/telegram/telegram_test.go | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/channels/telegram/telegram.go b/pkg/channels/telegram/telegram.go index a0b5cc511..924ea2787 100644 --- a/pkg/channels/telegram/telegram.go +++ b/pkg/channels/telegram/telegram.go @@ -212,7 +212,12 @@ func (c *TelegramChannel) Send(ctx context.Context, msg bus.OutboundMessage) err // sendChunk sends a single HTML/MarkdownV2 message, falling back to the original // markdown as plain text on parse failure so users never see raw HTML/MarkdownV2 tags. -func (c *TelegramChannel) sendChunk(ctx context.Context, chatID int64, content, mdFallback string, useMarkdownV2 bool) error { +func (c *TelegramChannel) sendChunk( + ctx context.Context, + chatID int64, + content, mdFallback string, + useMarkdownV2 bool, +) error { tgMsg := tu.Message(tu.ID(chatID), content) if useMarkdownV2 { tgMsg.WithParseMode(telego.ModeMarkdownV2) diff --git a/pkg/channels/telegram/telegram_test.go b/pkg/channels/telegram/telegram_test.go index 3a2f1aa66..475ee39e5 100644 --- a/pkg/channels/telegram/telegram_test.go +++ b/pkg/channels/telegram/telegram_test.go @@ -14,6 +14,7 @@ import ( "github.com/sipeed/picoclaw/pkg/bus" "github.com/sipeed/picoclaw/pkg/channels" + "github.com/sipeed/picoclaw/pkg/config" ) const testToken = "1234567890:aaaabbbbaaaabbbbaaaabbbbaaaabbbbccc" @@ -77,6 +78,7 @@ func newTestChannel(t *testing.T, caller *stubCaller) *TelegramChannel { BaseChannel: base, bot: bot, chatIDs: make(map[string]int64), + config: config.DefaultConfig(), } }