untilEOL returns v, truncated before the first '\n' byte, if any. The returned slice may include a '\r' at the end.
(v []byte)
| 92 | // untilEOL returns v, truncated before the first '\n' byte, if any. |
| 93 | // The returned slice may include a '\r' at the end. |
| 94 | func untilEOL(v []byte) []byte { |
| 95 | if i := bytes.IndexByte(v, '\n'); i != -1 { |
| 96 | return v[:i] |
| 97 | } |
| 98 | return v |
| 99 | } |
no outgoing calls
no test coverage detected