read

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(prompt string) (result bool, err error)

Bool retourne le booléen saisi.

func Default

func Default[T any](prompt string, def T, pp console.ParsedPromptFunc[T]) (result T, err error)

Default lance une invite de commande attendant une réponse optionnelle

func Float

func Float(prompt string) (result float64, err error)

Float retourne le nombre décimal saisi.

func Int

func Int(prompt string) (result int, err error)

Int retourne l’entier saisi.

func Password

func Password(prompt string) (result string, err error)

Password agit comme String mais n’affiche pas ce qui est saisi.

func Question

func Question(q string, def string) (result string)

Question invite à saisir une chaîne. Si aucune chaîne n’est saisie, def est retourné.

func QuestionBool

func QuestionBool(q string, def bool) (result bool)

QuestionBool invite à saisir un booléen. Si aucun booléen n’est saisi, def est retourné.

func QuestionChoice

func QuestionChoice(q string, def string, choices []string) (result string)

QuestionChoice invite à saisir un chaîne parmi un choix donné. Si aucun choix n’est effectué, retourne def.

func QuestionFloat

func QuestionFloat(q string, def float64) (result float64)

QuestionFloat invite à saisir un nombre décimal. Si aucun nombre décimal n’est saisi, def est retourné.

func QuestionInt

func QuestionInt(q string, def int) (result int)

QuestionInt invite à saisir un entier. Si aucun entier n’est saisi, def est retourné.

func QuestionUint

func QuestionUint(q string, def uint) (result uint)

QuestionUint invite à saisir un entier non signé. Si aucun entier non signé n’est saisi, def est retourné.

func Slice

func Slice(prompt string, t ...scanner.Tokenizer) (result []string, err error)

Slice retourne les mots saisis.

func SliceBool

func SliceBool(prompt string, t ...scanner.Tokenizer) (result []bool, err error)

SliceBool retourne les booléens saisis.

func SliceFloat

func SliceFloat(prompt string, t ...scanner.Tokenizer) (result []float64, err error)

SliceFloat retourne les nombres décimaux saisis.

func SliceInt

func SliceInt(prompt string, t ...scanner.Tokenizer) (result []int, err error)

SliceInt retourne les entiers saisis.

func SliceUint

func SliceUint(prompt string, t ...scanner.Tokenizer) (result []uint, err error)

SliceUint retourne les entiers non signés saisis.

func String

func String(prompt string) (result string, err error)

String retourne la chaîne de caractères saisie.

func Uint

func Uint(prompt string) (result uint, err error)

Uint retourne l’entier non signé saisi.

Types

This section is empty.

Jump to

Keyboard shortcuts

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