()
| 29 | ) |
| 30 | |
| 31 | func readInput() (string, error) { |
| 32 | reader := bufio.NewReader(os.Stdin) |
| 33 | input, err := reader.ReadString('\n') |
| 34 | if err != nil { |
| 35 | return "", errors.Wrap(err, "reading stdin") |
| 36 | } |
| 37 | |
| 38 | return strings.Trim(input, "\r\n"), nil |
| 39 | } |
| 40 | |
| 41 | // PromptInput prompts the user input and saves the result to the destination |
| 42 | func PromptInput(message string, dest *string) error { |