Documentation ¶
Index ¶
- func Ask(q string) (string, error)
- func Confirm(question string) (bool, error)
- func Fask(q string, w io.Writer, r io.Reader) (string, error)
- func Fconfirm(question string, w io.Writer, r io.Reader) (bool, error)
- func Fwhile(q string, v ValidateFunc, w io.Writer, r io.Reader) (string, error)
- func While(q string, v ValidateFunc) (string, error)
- type ValidateFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ask ¶
Ask writes a question to the standard output and reads the answer from the standard input.
func Confirm ¶
Confirm prompts the user with a yes/no question. Keeps prompting the question until the users answers with "y" or "n". Returns a boolean value indicating if the user confirmed or infirmed. Question and answers are written and read back from standard output/input.
func Fconfirm ¶
Fconfirm prompts the user with a yes/no question. Keeps prompting the question until the users answers with "y" or "n". Returns a boolean value indicating if the user confirmed or infirmed.
Types ¶
type ValidateFunc ¶
ValidateFunc is a function that is used to validate that an answer matches the expectations. It should return a boolean and an additional validation failure message when the validation fails.