summaryrefslogtreecommitdiff
path: root/internal/utils.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-02 21:47:12 +0300
committerPaul Buetow <paul@buetow.org>2026-04-02 21:47:12 +0300
commit993b2efe63e221cee550756770894c9c58474d25 (patch)
tree126b0dad9e1225c575f2521f29c6ad68556f4056 /internal/utils.go
parentdac35c77721c97f093a44d98164b38534452de9f (diff)
task 00g/00k/00h/008: gofmt, remove ProviderWithFallback, stdlib helpers, shared prompt
- 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 <noreply@anthropic.com>
Diffstat (limited to 'internal/utils.go')
-rw-r--r--internal/utils.go12
1 files changed, 6 insertions, 6 deletions
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 <= 'Я')
+}