ask

Ask the user a question on the command line

BSD-3-CLAUSE License

Stars
7
Committers
1

ask

Ask the user a question on the command line.

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