package main import ( "flag" "os" "golang.org/x/term" ) var file = flag.String("f", "cards", "cards file") func main() { flag.Parse() // Put terminal into raw mode oldState, err := term.MakeRaw(int(os.Stdin.Fd())) if err != nil { panic(err) } defer term.Restore(int(os.Stdin.Fd()), oldState) }