INNER CODE UNIT · Go
executor
c-bata/go-prompt · _example/live-prefix/main.go:14
func executor(in string) {
fmt.Println("Your input: " + in)
if in == "" {
LivePrefixState.IsEnable = false
LivePrefixState.LivePrefix = in
return
}
LivePrefixState.LivePrefix = in + "> "
LivePrefixState.IsEnable = true
}
func completer(in prompt.Document) []prompt.Suggest {
s := []prompt.Suggest{
{Text: "users", Description: "Store the username and age"},
{Text: "articles", Description: "Store the article text posted by user"},
{Text: "comments", Description: "Store the text commented to articles"},
{Text: "groups", Description: "Combine users with specific rules"},
}