Skip to content

Commit

Permalink
is -> items
Browse files Browse the repository at this point in the history
  • Loading branch information
koki-develop committed Mar 26, 2023
1 parent 8edcf60 commit 8982c2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/gofzf/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ var rootCmd = &cobra.Command{
RunE: func(cmd *cobra.Command, args []string) error {
sc := bufio.NewScanner(os.Stdin)

var is []string
var items []string
for sc.Scan() {
is = append(is, sc.Text())
items = append(items, sc.Text())
}

f := fzf.New(
Expand Down Expand Up @@ -147,13 +147,13 @@ var rootCmd = &cobra.Command{
}),
),
)
choices, err := f.Find(is, func(i int) string { return is[i] })
choices, err := f.Find(items, func(i int) string { return items[i] })
if err != nil {
return err
}

for _, choice := range choices {
fmt.Println(is[choice])
fmt.Println(items[choice])
}
return nil
},
Expand Down

0 comments on commit 8982c2c

Please sign in to comment.