From 993b2efe63e221cee550756770894c9c58474d25 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 2 Apr 2026 21:47:12 +0300 Subject: task 00g/00k/00h/008: gofmt, remove ProviderWithFallback, stdlib helpers, shared prompt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - task 00g: fix gofmt violations (trailing whitespace, missing newlines, indentation) in 8 files; all pass gofmt -l now - task 00k: remove unused ProviderWithFallback and its tests (YAGNI — no production caller existed; voice-level fallback via RunWithVoiceFallbacks already covers the real use case) - task 00h: replace private splitLines/trimSpace/isSpace helpers in internal/batch/processor.go with strings.Split+ReplaceAll and strings.TrimSpace from the stdlib; remove the now-redundant tests - task 008: extract buildEducationalPrompt into internal/image/prompt.go so the prompt-assembly policy (scene truncation cascade, char limit) lives in one place; both OpenAIClient and NanoBananaClient delegate to it Co-Authored-By: Claude Sonnet 4.6 --- internal/utils.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'internal/utils.go') diff --git a/internal/utils.go b/internal/utils.go index c135f9b..47513ae 100644 --- a/internal/utils.go +++ b/internal/utils.go @@ -14,11 +14,11 @@ func GenerateCardID(bulgarianWord string) string { // Get current timestamp in milliseconds now := time.Now() epochMillis := now.UnixNano() / 1000000 - + // Calculate MD5 hash of the word hash := md5.Sum([]byte(bulgarianWord)) hashStr := hex.EncodeToString(hash[:])[:8] // Use first 8 chars of MD5 - + // Combine timestamp and hash return fmt.Sprintf("%d_%s", epochMillis, hashStr) } @@ -40,7 +40,7 @@ func SanitizeFilename(s string) string { // isAlphaNumeric checks if a rune is alphanumeric func isAlphaNumeric(r rune) bool { - return (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') || - (r >= '0' && r <= '9') || (r >= 'а' && r <= 'я') || - (r >= 'А' && r <= 'Я') -} \ No newline at end of file + return (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') || + (r >= '0' && r <= '9') || (r >= 'а' && r <= 'я') || + (r >= 'А' && r <= 'Я') +} -- cgit v1.2.3