take care of warnings
This commit is contained in:
parent
d0b4567855
commit
9b973356a8
5
main.go
5
main.go
@ -44,6 +44,7 @@ func initGame() {
|
|||||||
ClearScreen()
|
ClearScreen()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ClearScreen clear all output on screen
|
||||||
func ClearScreen() {
|
func ClearScreen() {
|
||||||
cmd := exec.Command("clear")
|
cmd := exec.Command("clear")
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
@ -51,11 +52,11 @@ func ClearScreen() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func input(s string) (string, error) {
|
func input(s string) (string, error) {
|
||||||
stdin_buf := bufio.NewReader(os.Stdin)
|
stdinBuf := bufio.NewReader(os.Stdin)
|
||||||
|
|
||||||
fmt.Print(s)
|
fmt.Print(s)
|
||||||
|
|
||||||
text, err := stdin_buf.ReadString('\n')
|
text, err := stdinBuf.ReadString('\n')
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user