Closed Charliego3 closed 5 years ago
You forgot to add a code snippet for reproducing the issue.
I suppose, you copied this line from the example, which is responsible for transforming the input to Title Case.
Transform: survey.Title,
Sorry, I did forget to add the code.
func main() {
answers := struct {
Address string `survey:"address"`
Env string `survey:"environment"`
}{}
var qs = []*survey.Question{
{
Name: "address",
Prompt: &survey.Input{Message: "What is the withdrawal address?"},
Validate: survey.Required,
Transform: survey.Title,
},
{
Name: "environment",
Prompt: &survey.Select{
Message: "Choose a environment:",
Options: []string{"zbg"},
Default: "zbg",
},
},
}
// perform the questions
err := survey.Ask(qs, &answers)
if err != nil {
log.Println(errorP, err.Error(), end)
return
}
fmt.Println(answers)
}
And I delete Transform: survey.Title,
then is ok.
Thanks for your help.
I'm happy you were able to figure this out @whimthen! Thanks @orymate for helping out
As the title says, I type 'loveparadise_l' and automatically change to 'Loveparadise_l'