splitOnCRLFRuns splits s at the end of each run of \r and \n characters. Each segment includes its trailing CR/LF run. The last segment may have no such run.
(s string)
| 184 | // splitOnCRLFRuns splits s at the end of each run of \r and \n characters. |
| 185 | // Each segment includes its trailing CR/LF run. The last segment may have no such run. |
| 186 | func splitOnCRLFRuns(s string) []string { |
| 187 | var result []string |
| 188 | for len(s) > 0 { |
| 189 | // find start of next CR/LF run |
| 190 | i := 0 |
| 191 | for i < len(s) && s[i] != '\r' && s[i] != '\n' { |
| 192 | i++ |
| 193 | } |
| 194 | if i == len(s) { |
| 195 | break |
| 196 | } |
| 197 | // consume the CR/LF run |
| 198 | j := i |
| 199 | for j < len(s) && (s[j] == '\r' || s[j] == '\n') { |
| 200 | j++ |
| 201 | } |
| 202 | result = append(result, s[:j]) |
| 203 | s = s[j:] |
| 204 | } |
| 205 | if len(s) > 0 { |
| 206 | result = append(result, s) |
| 207 | } |
| 208 | return result |
| 209 | } |
| 210 | |
| 211 | func formatDebugTermDecode(data []byte) string { |
| 212 | if len(data) == 0 { |
no outgoing calls
no test coverage detected