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
|
|
|
|
}
|
|
|
|
|
2021-03-26 16:18:03 -04:00
|
|
|
// Print string to stdout
|
2021-04-06 16:44:59 -04:00
|
|
|
func Write(s string) {
|
|
|
|
fmt.Print(s)
|
2021-03-25 13:20:33 -04:00
|
|
|
}
|
|
|
|
|