golang: survay

https://github.com/AlecAivazis/survey

A golang library for building interactive prompts with full support for windows and posix terminals.

multiline

text := ""
prompt := &survey.Multiline{
    Message: "ping",
}
survey.AskOne(prompt, &text)

multiselect

days := []string{}
prompt := &survey.MultiSelect{
    Message: "What days do you prefer:",
    Options: []string{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"},
}
survey.AskOne(prompt, &days)
Publikováno v Go