confirm

package
v0.0.0-...-2caf503 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ask

func Ask(s string) bool

Ask asks the user for confirmation. A user must type in "yes" or "no" and then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again. The function does not return until it gets a valid response from the user.

func AskStrict

func AskStrict(s string, c string) bool

AskStrict asks the user for confirmation. A user must type the expected confirmation text and then press enter.

func AskStrictOneOf

func AskStrictOneOf(s string, c []string) (bool, string)

AskStrictOneOf asks the user for confirmation. A user must type one of the expected confirmation values and then press enter.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL