Use fmt.Scanln for exchange templating tool

This commit is contained in:
Adrian Gallagher
2018-02-19 10:19:27 +11:00
parent d41c5c358c
commit f1123afa1f

View File

@@ -1,7 +1,6 @@
package main
import (
"bufio"
"flag"
"fmt"
"html/template"
@@ -70,15 +69,15 @@ func main() {
fmt.Println("REST Supported: ", restSupport)
fmt.Println("FIX Supported: ", fixSupport)
fmt.Println()
fmt.Println("Please check if everything is correct then press enter to continue...")
fmt.Println("Please check if everything is correct and then type y to continue or n to cancel...")
reader := bufio.NewReader(os.Stdin)
choice, _, err := reader.ReadRune()
var choice []byte
_, err := fmt.Scanln(&choice)
if err != nil {
log.Fatal("GoCryptoTrader: Exchange templating tool bufio.reader error ", err)
log.Fatal("GoCryptoTrader: Exchange templating tool fmt.Scanln ", err)
}
if choice != '\n' {
if !common.YesOrNo(string(choice)) {
log.Fatal("GoCryptoTrader: Exchange templating tool stopped...")
}