Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfirmDefaultAllow ¶
func ConfirmDefaultAllow() bool
ConfirmDefaultAllow is a helper function to confirm with the user for a question. It will only return false if the user types "no". If the user types "quit" then the program will exit. This method does NOT offer a text prompt to the user. You must do that before calling this method. For example
output.Println("Are you sure you want to do this? (YES/no)")
if input.ConfirmDefaultAllow() {
return
}
output.Println("Doing the thing...")
The prompt can be whatever you want, but you should include the final `(YES/no)` part as if the user does not type anything it will default to "yes".
func ConfirmDefaultDeny ¶
func ConfirmDefaultDeny() bool
ConfirmDefaultDeny is a helper function to confirm with the user for a question. It will only return true if the user types "yes". If the user types "quit" then the program will exit. This method does NOT offer a text prompt to the user. You must do that before calling this method. For example
output.Println("Are you sure you want to do this? (yes/NO)")
if !input.ConfirmDefaultDeny() {
return
}
output.Println("Doing the thing...")
The prompt can be whatever you want, but you should include the final `(yes/NO)` part as if the user does not type anything it will default to "no".
Types ¶
This section is empty.