Convert a multi-line string into an array of strings
(in string)
| 148 | |
| 149 | // Convert a multi-line string into an array of strings |
| 150 | func splitLines(in string) []string { |
| 151 | var res []string |
| 152 | |
| 153 | s := bufio.NewScanner(strings.NewReader(in)) |
| 154 | for s.Scan() { |
| 155 | res = append(res, s.Text()) |
| 156 | } |
| 157 | |
| 158 | return res |
| 159 | } |
| 160 | |
| 161 | // This function parses the "size" parameter of a disk specification |
| 162 | // and returns the size in MB. The "size" parameter defaults to GB, but |
no outgoing calls
no test coverage detected