ci: fix lint
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Andrey Nering · committed by Andrey Nering · parent 5adfa5b · Browse files · 6 files·+9 added−7 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+9 added−7 removed
- other:+9 added−7 removed
Provenance
- Commit
b0471e8- Tree
018ec10- Author
Andrey Nering <andreynering@users.noreply.github.com>- Committer
Andrey Nering <andreynering@users.noreply.github.com>- Parent
5adfa5b
6 files changed+9 added−7 removed
modified:choose/command.go+1 added-1 removed
37 unmodified lines38 39 // normalize options into a map40 options := map[string]string{}41 // keep the labels in the user-provided order42- var labels []string //nolint:prealloc42+ var labels []string43 for _, opt := range o.Options {44 if o.LabelDelimiter == "" {45 options[opt] = opt46 continue136 unmodified linesmodified:completion/zsh.go+4 added-4 removed
31 unmodified lines32 var str strings.Builder33 str.WriteString(" ")34 if f.Short != 0 {35 str.WriteString("'(")36- str.WriteString(fmt.Sprintf("-%c --%s", f.Short, f.Name))36+ fmt.Fprintf(&str, "-%c --%s", f.Short, f.Name)37 if !f.IsBool() {38 str.WriteString("=")39 }40 str.WriteString(")'")41 str.WriteString("{")42- str.WriteString(fmt.Sprintf("-%c,--%s", f.Short, f.Name))42+ fmt.Fprintf(&str, "-%c,--%s", f.Short, f.Name)43 if !f.IsBool() {44 str.WriteString("=")45 }46 str.WriteString("}")47 str.WriteString("\"")48 } else {49 str.WriteString("\"")50- str.WriteString(fmt.Sprintf("--%s", f.Name))50+ fmt.Fprintf(&str, "--%s", f.Name)51 if !f.IsBool() {52 str.WriteString("=")53 }54 }55- str.WriteString(fmt.Sprintf("[%s]", f.Help))55+ fmt.Fprintf(&str, "[%s]", f.Help)56 if !f.IsBool() {57 str.WriteString(":")58 str.WriteString(strings.ToLower(f.Help))59 str.WriteString(":")87 unmodified linesmodified:filter/command.go+1 added-1 removed
164 unmodified lines165 return nil166 }167 168 func (o Options) checkSelected(m model) {169- out := []string{}169+ out := make([]string, 0, len(m.selected))170 for k := range m.selected {171 out = append(out, k)172 }173 tty.Println(strings.Join(out, o.OutputDelimiter))1 unmodified linemodified:filter/filter.go+1 added-1 removed
487 unmodified lines488 matchedString := strings.ToLower(choice)489 490 index := strings.Index(matchedString, search)491 if index >= 0 {492- matchedIndexes := []int{}492+ matchedIndexes := make([]int, 0, len(search))493 for s := range search {494 matchedIndexes = append(matchedIndexes, index+s)495 }496 matches = append(matches, fuzzy.Match{53 unmodified linesmodified:format/formats.go+1 added
1+//nolint2 package format3 4 import (5 "bytes"62 unmodified linesmodified:format/options.go+1 added
1+//nolint2 package format3 4 // Options is customization options for the format command.5 type Options struct {8 unmodified lines