Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserInput ¶
type UserInput struct {
// contains filtered or unexported fields
}
UserInput provides methods for reading user input from the console
func New ¶
func New() *UserInput
New creates a new UserInput instance with a bufio.Reader for reading user input, and pre-defined lists of false and true alternative input values.
func (*UserInput) ReadBool ¶
ReadBool reads a boolean value from the user input. It accepts a variety of common boolean string representations (e.g. "y", "yes", "t", "true", "1", "n", "no", "f", "false", "0") and returns the corresponding boolean value. If the input is not a valid boolean representation, it returns an error.
func (*UserInput) ReadFloat ¶
ReadFloat reads a float64 value from the user, prompting with the given string. It returns the float64 value read, or an error if there was a problem reading the input.