stash/vendor/github.com/gobuffalo/genny/confirm.go
2019-02-09 04:32:50 -08:00

15 lines
214 B
Go

package genny
import (
"bufio"
"fmt"
"os"
)
func Confirm(msg string) bool {
reader := bufio.NewReader(os.Stdin)
fmt.Print(msg)
text, _ := reader.ReadString('\n')
return (text == "y\n" || text == "Y\n")
}