From 4cbe2d8e671f5037af193b4f668be7a10d8cb5ab Mon Sep 17 00:00:00 2001 From: lordwelch Date: Tue, 7 Nov 2017 14:57:24 -0700 Subject: [PATCH] Stop unnecessary panic --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index c7622f3..9b461b7 100644 --- a/main.go +++ b/main.go @@ -130,6 +130,11 @@ func main() { r, _, err = stdin.ReadRune() fmt.Printf("%s\n", string(r)) + + if err == io.EOF { + break + } + if err != nil { panic(err) } @@ -141,7 +146,7 @@ func main() { Press([8]byte{flag, 0, report[0], report[1], report[2], report[3], report[4], report[5]}, hidg0) } - + fmt.Println("Success!") hidg0.Close() }