prompt

package
v0.0.0-...-9eb9cba Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func P

func P(msg string, args ...interface{}) error

P prints msg, then reads a line of user input. The input line is then scanned into the args using fmt.Sscan().

This doesn't use fmt.Scanln() because prompt() is often called in a loop (running until user input is valid) and Scanln returns two separate errors for example when scanning into one integer and "a\n" is read from stdin, resulting in the prompt message being printed twice.

func WithDefault

func WithDefault(msg string, arg *string, defaultValue string) error

WithDefault prints msg, then parses a line of user input into

Types

This section is empty.

Jump to

Keyboard shortcuts

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