stash/vendor/github.com/gobuffalo/genny/confirm.go

16 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")
}