prompt

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InputBool

func InputBool(message string, defaultValue bool) (bool, error)

InputBool prompts the user for a boolean input and returns it

The default value is used if the user doesn't enter anything The message should not contain the "(y/n)" part

func InputLine

func InputLine(message string) (string, error)

InputLine prompts the user for an input and returns it

func InputSelect

func InputSelect(message string, options []string) (string, error)

InputSelect prompts the user to select an option from a list

func InputWithValidation

func InputWithValidation(message string, errorMessage string, validation func(string) bool) (string, error)

Prompt the user for a string input and validate it If the input is not valid, the error message is displayed and the user is prompted again The validation function should return true if the input is valid

Types

This section is empty.

Jump to

Keyboard shortcuts

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