initial commit

This commit is contained in:
Gardient
2018-06-07 22:50:47 +03:00
commit 926aeb4eee
7 changed files with 252 additions and 0 deletions

21
utils/readLine.go Normal file
View File

@@ -0,0 +1,21 @@
package utils
import (
"bufio"
"os"
"strings"
)
var rd *bufio.Reader
// ReadLine reads a line from stdin and strips newline from the end
func ReadLine() string {
if rd == nil {
rd = bufio.NewReader(os.Stdin)
}
str, err := rd.ReadString('\n')
PanicOnError(err)
return strings.TrimRight(str, "\r\n")
}