From 52ca27461c433fb216c844af0bbedf60b7067591 Mon Sep 17 00:00:00 2001 From: Aleksandr Bortnikov Date: Wed, 11 Mar 2026 10:23:20 +0300 Subject: [PATCH] fix: linter issues --- pkg/channels/telegram/parse_markdown_to_md_v2.go | 6 +++--- pkg/channels/telegram/parser_markdown_to_html.go | 6 ------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/pkg/channels/telegram/parse_markdown_to_md_v2.go b/pkg/channels/telegram/parse_markdown_to_md_v2.go index 4ed3b228c..8cae312c5 100644 --- a/pkg/channels/telegram/parse_markdown_to_md_v2.go +++ b/pkg/channels/telegram/parse_markdown_to_md_v2.go @@ -36,7 +36,7 @@ type entityPattern struct { close string } -// allEntityPatterns lists every recognised entity in priority order +// allEntityPatterns lists every recognized entity in priority order // (longer / more-specific delimiters first so they win over shorter ones). // Each entry's regex is anchored to find the first occurrence in a string. var allEntityPatterns = []entityPattern{ @@ -82,7 +82,7 @@ var verbatimEntities = map[string]bool{ // Rules: // - Markdown headings (# … ######) are converted to *bold*. // - **bold** Markdown syntax is converted to *bold*. -// - Recognised Telegram MarkdownV2 entity spans are preserved; their inner +// - Recognized Telegram MarkdownV2 entity spans are preserved; their inner // content is processed recursively so that nested valid entities are kept // intact while stray special characters are escaped. // - All plain-text segments have their MarkdownV2 special characters escaped. @@ -172,7 +172,7 @@ func processText(text string) string { } // escapeMarkdownV2 escapes every MarkdownV2 special character in a plain-text -// segment (i.e. a segment that is not part of any recognised entity). +// segment (i.e. a segment that is not part of any recognized entity). // Already-escaped sequences (backslash + char) are forwarded verbatim to avoid // double-escaping. func escapeMarkdownV2(s string) string { diff --git a/pkg/channels/telegram/parser_markdown_to_html.go b/pkg/channels/telegram/parser_markdown_to_html.go index f24ee45cc..bdaa51807 100644 --- a/pkg/channels/telegram/parser_markdown_to_html.go +++ b/pkg/channels/telegram/parser_markdown_to_html.go @@ -109,9 +109,3 @@ func escapeHTML(text string) string { text = strings.ReplaceAll(text, ">", ">") return text } - -func parseChatID(chatIDStr string) (int64, error) { - var id int64 - _, err := fmt.Sscanf(chatIDStr, "%d", &id) - return id, err -}