on main help sign in
chore: run `modernize`
commit5e23ecdb4da522af4db2251b96d92e0c368389df authorAndrey Nering <andreynering@users.noreply.github.com> dateTue 10 Feb 2026, 11:08 (8 months ago) parent29800c4
5 files changed+9−14
internal/agent/tools/search.go+2−2 internal/config/config.go+2−2 internal/csync/value_test.go+2−4 internal/shell/shell.go+2−2 internal/ui/model/chat.go+1−4
internal/agent/tools/search.go+2−2
@@ -172,8 +172,8 @@ func getTextContent(n *html.Node) string {
172172
173173func cleanDuckDuckGoURL(rawURL string) string {
174174 if strings.HasPrefix(rawURL, "//duckduckgo.com/l/?uddg=") {
175− if idx := strings.Index(rawURL, "uddg="); idx != -1 {
176− encoded := rawURL[idx+5:]
175+ if _, after, ok := strings.Cut(rawURL, "uddg="); ok {
176+ encoded := after
177177 if ampIdx := strings.Index(encoded, "&"); ampIdx != -1 {
178178 encoded = encoded[:ampIdx]
179179 }
internal/config/config.go+2−2
@@ -350,7 +350,7 @@ type Agent struct {
350350}
351351
352352type Tools struct {
353− Ls ToolLs `json:"ls,omitempty"`
353+ Ls ToolLs `json:"ls"`
354354}
355355
356356type ToolLs struct {
@@ -383,7 +383,7 @@ type Config struct {
383383
384384 Permissions *Permissions `json:"permissions,omitempty" jsonschema:"description=Permission settings for tool usage"`
385385
386− Tools Tools `json:"tools,omitempty" jsonschema:"description=Tool configurations"`
386+ Tools Tools `json:"tools" jsonschema:"description=Tool configurations"`
387387
388388 Agents map[string]Agent `json:"-"`
389389
internal/csync/value_test.go+2−4
@@ -83,11 +83,9 @@ func TestValue_ConcurrentAccess(t *testing.T) {
8383
8484 // Concurrent readers.
8585 for range 100 {
86− wg.Add(1)
87− go func() {
88− defer wg.Done()
86+ wg.Go(func() {
8987 _ = v.Get()
90− }()
88+ })
9189 }
9290
9391 wg.Wait()
internal/shell/shell.go+2−2
@@ -207,8 +207,8 @@ func splitArgsFlags(parts []string) (args []string, flags []string) {
207207 if strings.HasPrefix(part, "-") {
208208 // Extract flag name before '=' if present
209209 flag := part
210− if idx := strings.IndexByte(part, '='); idx != -1 {
211− flag = part[:idx]
210+ if before, _, ok := strings.Cut(part, "="); ok {
211+ flag = before
212212 }
213213 flags = append(flags, flag)
214214 } else {
internal/ui/model/chat.go+1−4
@@ -745,10 +745,7 @@ func (m *Chat) selectWord(itemIdx, x, itemY int) {
745745 // Adjust x for the item's left padding (border + padding) to get content column.
746746 // The mouse x is in viewport space, but we need content space for boundary detection.
747747 offset := chat.MessageLeftPaddingTotal
748− contentX := x - offset
749− if contentX < 0 {
750− contentX = 0
751− }
748+ contentX := max(x-offset, 0)
752749
753750 line := ansi.Strip(lines[itemY])
754751 startCol, endCol := findWordBoundaries(line, contentX)