Skip to content

xyproto/ask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ask

Ask the user a question on the command line.

Go GoDoc License Go Report Card

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