Functions below this line are borrowed or adapted from encoding/csv/reader.go lengthNL returns 1 if the last byte in b is a newline, 0 otherwise.
(b []byte)
| 143 | |
| 144 | // lengthNL returns 1 if the last byte in b is a newline, 0 otherwise. |
| 145 | func lengthNL(b []byte) int { |
| 146 | if len(b) > 0 && b[len(b)-1] == '\n' { |
| 147 | return 1 |
| 148 | } |
| 149 | return 0 |
| 150 | } |
| 151 | |
| 152 | // readLine reads the next line (with the trailing endline). |
| 153 | // If EOF is hit without a trailing endline, it will be omitted. |
no outgoing calls
no test coverage detected