mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-01 18:58:26 +02:00
43 lines
686 B
Go
43 lines
686 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/AlecAivazis/survey"
|
|
)
|
|
|
|
var simpleQs = []*survey.Question{
|
|
{
|
|
Name: "color",
|
|
Prompt: &survey.Select{
|
|
Message: "select1:",
|
|
Options: []string{"red", "blue", "green"},
|
|
},
|
|
Validate: survey.Required,
|
|
},
|
|
{
|
|
Name: "color2",
|
|
Prompt: &survey.Select{
|
|
Message: "select2:",
|
|
Options: []string{"red", "blue", "green"},
|
|
},
|
|
Validate: survey.Required,
|
|
},
|
|
}
|
|
|
|
func main() {
|
|
answers := struct {
|
|
Color string
|
|
Color2 string
|
|
}{}
|
|
// ask the question
|
|
err := survey.Ask(simpleQs, &answers)
|
|
|
|
if err != nil {
|
|
fmt.Println(err.Error())
|
|
return
|
|
}
|
|
// print the answers
|
|
fmt.Printf("%s and %s.\n", answers.Color, answers.Color2)
|
|
}
|