- package Helper
-
- import (
- "bufio"
- "os"
- "strings"
- )
-
- var (
- reader *bufio.Reader = bufio.NewReader(os.Stdin)
- )
-
- func Input() string {
- var (
- text string
- err error
- )
- text, err = reader.ReadString('\n')
- if err != nil {
- panic(err)
- }
-
- // convert CRLF to LF
- return strings.Replace(text, "\n", "", -1)
- }
|