prompt

package module
v0.0.0-...-2fee340 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: MIT Imports: 4 Imported by: 1

README

PROMPT

A Go 1.18 generics based package to create a command line readline style prompt that gets you the type you ask for. Supports reading in complex types when the Prompter interface is being used. Falls back on fmt.Scan, which might fail.

Usage:

import "git.kiefte.eu/lapingvino/prompt"

And see example.

Feel free to be inspired and include an improved version in your packages. This is not meant to be maintained.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustRead

func MustRead[T any]() T

func Read

func Read[T any]() (out T, err error)

Types

type Prompter

type Prompter interface {
	Prompt(string)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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