README ¶ ask Ask the user a question, using text. Example use package main import ( "fmt" "github.com/xyproto/ask" ) func main() { var ( yes bool name string ) for !yes { name = ask.Ask("What is your name? ") yes = ask.YesNo("Your name is "+name+"?", false) } fmt.Printf("Greetings, %s!\n", name) } General info Version: 1.0.2 Licence: BSD-3 Author: Alexander F. Rødseth <xyproto@archlinux.org> Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func Ask(prompt string) string func ReadLn() string func YesNo(question string, noIsDefault bool) bool Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Ask ¶ func Ask(prompt string) string Ask a question, wait for textual input followed by a newline. func ReadLn ¶ func ReadLn() string ReadLn will read a line from stdin, until \n. func YesNo ¶ added in v1.0.1 func YesNo(question string, noIsDefault bool) bool YesNo will ask a yes/no question. Will not wait for a newline. Types ¶ This section is empty. Source Files ¶ View all Source files ask.go Directories ¶ Show internal Expand all Path Synopsis cmd greet Click to show internal directories. Click to hide internal directories.