ReadValuesFromPipe will return an array of strings from the pipe input separated by new line.
()
| 13 | // ReadValuesFromPipe will return an array of strings from the pipe |
| 14 | // input separated by new line. |
| 15 | func ReadValuesFromPipe() []string { |
| 16 | items := []string{} |
| 17 | if IsCalledFromPipe() { |
| 18 | scanner := bufio.NewScanner(bufio.NewReader(os.Stdin)) |
| 19 | for scanner.Scan() { |
| 20 | items = append(items, scanner.Text()) |
| 21 | } |
| 22 | } |
| 23 | return items |
| 24 | } |
no test coverage detected