questions

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package questions provides interactive terminal prompting utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintToTerm

func PrintToTerm(text ...interface{})

PrintToTerm prints text to the terminal, using stderr if stdout is not a TTY.

func PrintfToTerm

func PrintfToTerm(msg string, format ...interface{})

PrintfToTerm prints formatted text to the terminal, using stderr if stdout is not a TTY.

func PrintlnToTerm

func PrintlnToTerm(text ...interface{})

PrintlnToTerm prints text with a newline to the terminal, using stderr if stdout is not a TTY.

func Prompt

func Prompt(text, def string) (string, error)

Prompt displays text and reads a required response from stdin.

func PromptBool

func PromptBool(text string, def bool) (bool, error)

PromptBool prompts the user for a yes/no answer and returns a boolean.

func PromptFormattedOptions

func PromptFormattedOptions(text string, def int, options ...string) (int, error)

PromptFormattedOptions displays numbered options and prompts the user to select one.

func PromptOptional

func PromptOptional(text, def string) (string, error)

PromptOptional displays text and reads an optional response from stdin, returning the default if empty.

func PromptOptions

func PromptOptions(text string, def int, options ...string) (int, error)

PromptOptions displays a list of options and prompts the user to select one by number.

Types

This section is empty.

Jump to

Keyboard shortcuts

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