From 6e73513aacf1e499fccb32ee0b09d90c22341214 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Thu, 20 Nov 2025 19:16:44 +0300 Subject: Chore: linter complaints --- models/models.go | 8 ++++++-- tables.go | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/models/models.go b/models/models.go index ea9bf2e..58f0291 100644 --- a/models/models.go +++ b/models/models.go @@ -154,17 +154,19 @@ func (m RoleMsg) ToText(i int) string { contentStr = m.Content } else { // For structured content, just take the text parts + var textParts []string for _, part := range m.ContentParts { if partMap, ok := part.(map[string]interface{}); ok { if partType, exists := partMap["type"]; exists && partType == "text" { if textVal, textExists := partMap["text"]; textExists { if textStr, isStr := textVal.(string); isStr { - contentStr += textStr + " " + textParts = append(textParts, textStr) } } } } } + contentStr = strings.Join(textParts, " ") + " " } // check if already has role annotation (/completion makes them) @@ -181,17 +183,19 @@ func (m RoleMsg) ToPrompt() string { contentStr = m.Content } else { // For structured content, just take the text parts + var textParts []string for _, part := range m.ContentParts { if partMap, ok := part.(map[string]interface{}); ok { if partType, exists := partMap["type"]; exists && partType == "text" { if textVal, textExists := partMap["text"]; textExists { if textStr, isStr := textVal.(string); isStr { - contentStr += textStr + " " + textParts = append(textParts, textStr) } } } } } + contentStr = strings.Join(textParts, " ") + " " } return strings.ReplaceAll(fmt.Sprintf("%s:\n%s", m.Role, contentStr), "\n\n", "\n") } diff --git a/tables.go b/tables.go index c359102..8fa80ed 100644 --- a/tables.go +++ b/tables.go @@ -561,7 +561,7 @@ func makeFilePicker() *tview.Flex { var selectedFile string // Track currently displayed directory (changes as user navigates) - var currentDisplayDir string = startDir + currentDisplayDir := startDir // Helper function to check if a file is an image isImageFile := func(filename string) bool { -- cgit v1.2.3