From 69b08b0a81594d6353a756ee19789740c52421cd Mon Sep 17 00:00:00 2001 From: Sean Hinchee Date: Wed, 26 Jul 2017 18:44:01 +0000 Subject: [PATCH] adding debug --- config.go | 11 +++++++++-- helper.go | 11 ----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/config.go b/config.go index ce1604b1e5e2acaa67f3b000beeac0c43a2e6931..2281b3c5623faf59896e7fa57c62d006036dc33d 100644 --- a/config.go +++ b/config.go @@ -77,11 +77,18 @@ func CreateConfig() { password := ""; if plan9 { - password = GetPass() - + cons, err := os.OpenFile("/dev/cons", os.O_RDWR, 0600) + if err != nil { + fmt.Println("Failed to open /dev/cons") + } + consScan := bufio.NewScanner(cons) + consScan.Scan() + password = consScan.Text() + err = RawOff() if err != nil { fmt.Println("Failed to set rawoff") + fmt.Print(err, "\n") } } else { /* Maybe put linux terminal raw mode in here one day */ diff --git a/helper.go b/helper.go index f0c2e859a36cd72163bccf9e5e46710f6601bfd1..c4116d0c0cdc4d29a3a4f2438f2375cebc1fb3fe 100644 --- a/helper.go +++ b/helper.go @@ -8,7 +8,6 @@ import ( "time" "fmt" "bitbucket.org/henesy/disco/DiscordGo" - "bufio" ) //HexColor is a struct gives RGB values @@ -129,13 +128,3 @@ func RawOff() error { return nil } - -func GetPass() string { - cons, err := os.OpenFile("/dev/cons", os.O_RDWR, 0600) - if err != nil { - fmt.Println("Failed to open /dev/cons") - } - consScan := bufio.NewScanner(cons) - consScan.Scan() - return consScan.Text() -}