fix: all issues by golangci-lint

This commit is contained in:
verse91
2026-05-09 23:49:33 +07:00
parent e587f02798
commit c76541258a
18 changed files with 118 additions and 79 deletions
+3 -5
View File
@@ -6,6 +6,7 @@ package fs
import (
"bytes"
"context"
"os"
"os/exec"
"strings"
@@ -35,7 +36,7 @@ func ZoxideGenerator() core.GeneratorFunc {
localSuggestions := core.FileGenerator("/")(tokens, prefix, fullQuery)
var zoxideSuggestions []core.Suggestion
cmd := exec.Command("zoxide", "query", "-l")
cmd := exec.CommandContext(context.Background(), "zoxide", "query", "-l")
out, err := cmd.Output()
if err == nil {
lines := strings.Split(string(bytes.TrimSpace(out)), "\n")
@@ -79,10 +80,7 @@ func ZoxideGenerator() core.GeneratorFunc {
var finalResults []core.Suggestion
seen := make(map[string]bool)
for _, s := range localSuggestions {
finalResults = append(finalResults, s)
}
finalResults = append(finalResults, localSuggestions...)
for _, s := range zoxideSuggestions {
if !seen[s.Cmd] {