Skip to content

Latest commit

 

History

History
82 lines (57 loc) · 2.47 KB

README.md

File metadata and controls

82 lines (57 loc) · 2.47 KB

go-fzf

Go Reference GitHub release (latest by date) GitHub Workflow Status Maintainability Go Report Card LICENSE

Fuzzy Finder CLI and Library.

English | 日本語

Contents

Usage

Using as a CLI

If you want to know what you can do with go-fzf, try the gofzf CLI.
The gofzf CLI is built with go-fzf and can utilize most of go-fzf's features.

For more information, please refer to the documentation.

Using as a library

With go-fzf, you can easily create a highly customizable Fuzzy Finder.
For example, you can create a Fuzzy Finder like the one below with just this simple code:

package main

import (
	"fmt"
	"log"

	"github.com/koki-develop/go-fzf"
)

func main() {
	items := []string{"hello", "world", "foo", "bar"}

	f, _ := fzf.New()
	if err != nil {
		log.Fatal(err)
	}

	idxs, err := f.Find(items, func(i int) string { return items[i] })
	if err != nil {
		log.Fatal(err)
	}

	for _, i := range idxs {
		fmt.Println(items[i])
	}
}

For more information, please refer to the documentation

Examples

Various examples of how to use go-fzf are available in the examples directory.

LICENSE

MIT