Skip to content

Instantly share code, notes, and snippets.

@luizbranco luizbranco/main.go
Created Nov 23, 2017

Embed
What would you like to do?
promptui demo step 9
list := promptui.Select{
Label: "Recipe",
Items: res.Results,
Templates: &templates,
Searcher: func(input string, idx int) bool {
recipe := res.Results[idx]
title := strings.ToLower(recipe.Title)
if strings.Contains(title, input) {
return true
}
if strings.Contains(recipe.Ingredients, input) {
return true
}
return false
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.