Closed richardltc closed 3 years ago
Yes, you can set the default when creating a survey.Confirm
component like this:
var answer bool
prompt := &survey.Confirm{
Message: "Do you like cookies?",
Default: true, // default to true/yes because who doesn't like them
}
survey.AskOne(prompt, &answer)
Close this since its resolved? @richardltc
Yes please. All sorted now.
Thanks
On Mon, 5 Oct 2020, 17:45 infixint943, notifications@github.com wrote:
Close this since its resolved? @richardltc https://github.com/richardltc
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AlecAivazis/survey/issues/294#issuecomment-703752381, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKXFD3U5KGEEKEDENLJKSQ3SJHZ4DANCNFSM4OWTRPKA .
Thank you, and sorry for they very later reply.
Richard
On Mon, 13 Jul 2020 at 10:15, Markus Freitag notifications@github.com wrote:
Yes, you can set the default when creating a survey.Confirm component like this:
var answer bool prompt := &survey.Confirm{ Message: "Do you like cookies?", Default: true, // default to true/yes because who doesn't like them } survey.AskOne(prompt, &answer)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AlecAivazis/survey/issues/294#issuecomment-657432774, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKXFD3WZCOJORG5MTTLS4Z3R3LGEJANCNFSM4OWTRPKA .
Is there a way that we can default a confirmation to either true or false?
Thanks