gilo/terminal/io.go

23 lines
275 B
Go
Raw Normal View History

2021-03-24 16:23:17 -04:00
package terminal
import (
"bufio"
"fmt"
"os"
)
var reader = bufio.NewReader(os.Stdin)
func ReadKey() (rune, int) {
ch, size, err := reader.ReadRune()
if err != nil {
panic(err)
}
return ch, size
}
// Print string to stdout
func Write(s string) {
fmt.Print(s)
}