Timothy J. Warren
6f51f441e3
All checks were successful
timw4mail/gilo/pipeline/head This commit looks good
24 lines
276 B
Go
24 lines
276 B
Go
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)
|
|
}
|