mirror of https://github.com/miguelmota/cointop
parent
a118bd38aa
commit
be84b5e5bd
@ -0,0 +1,21 @@
|
||||
package cointop
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func (ct *Cointop) readAPIKeyFromStdin(name string) string {
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
fmt.Printf("Enter %s API Key: ", name)
|
||||
text, err := reader.ReadString('\n')
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
return strings.TrimSpace(text)
|
||||
}
|
Loading…
Reference in New Issue