From 3389b1d83bc9fcc605fdff813c826410d07cfe28 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Mon, 2 Mar 2026 11:39:55 +0300 Subject: Fix: linter complaints --- bot.go | 12 ++++++------ tools.go | 4 ++-- tui.go | 3 +-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/bot.go b/bot.go index 98dd27f..2c1689f 100644 --- a/bot.go +++ b/bot.go @@ -1213,19 +1213,19 @@ func findCall(msg, toolCall string) bool { // Create RoleMsg with ContentParts var contentParts []any for _, part := range multimodalResp.Parts { - partType, ok := part["type"] - if !ok { - continue - } - if partType == "text" { + partType := part["type"] + switch partType { + case "text": contentParts = append(contentParts, models.TextContentPart{Type: "text", Text: part["text"]}) - } else if partType == "image_url" { + case "image_url": contentParts = append(contentParts, models.ImageContentPart{ Type: "image_url", ImageURL: struct { URL string `json:"url"` }{URL: part["url"]}, }) + default: + continue } } toolResponseMsg = models.RoleMsg{ diff --git a/tools.go b/tools.go index fc76933..a9bb9c0 100644 --- a/tools.go +++ b/tools.go @@ -250,8 +250,8 @@ func UpdateToolCapabilities() { logger.Info("model has vision support", "model", cfg.CurrentModel, "api", cfg.CurrentAPI) } else { logger.Info("model does not have vision support", "model", cfg.CurrentModel, "api", cfg.CurrentAPI) - if windowToolsAvailable && !prevHasVision && modelHasVision == false { - notifyUser("window tools", "Window capture-and-view unavailable: model lacks vision support") + if windowToolsAvailable && !prevHasVision && !modelHasVision { + _ = notifyUser("window tools", "Window capture-and-view unavailable: model lacks vision support") } } registerWindowTools() diff --git a/tui.go b/tui.go index 1f06598..d1ca5f0 100644 --- a/tui.go +++ b/tui.go @@ -213,8 +213,7 @@ func init() { pages.SwitchToPage("main") // or whatever your main page is named }) confirmModal.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { - switch event.Key() { - case tcell.KeyRune: + if event.Key() == tcell.KeyRune { switch event.Rune() { case 'y', 'Y': persona := cfg.UserRole -- cgit v1.2.3