FirstLine returns the first line of msg without its LF or CRLF ending.
(msg string)
| 91 | |
| 92 | // FirstLine returns the first line of msg without its LF or CRLF ending. |
| 93 | func FirstLine(msg string) string { |
| 94 | it := syntax.Lines(msg) |
| 95 | line, _ := it.Next() |
| 96 | return msg[line.Content.Start:line.Content.End] |
| 97 | } |
| 98 | |
| 99 | // ForEachLine iterates over lines in s without their LF or CRLF endings. |
| 100 | // Iteration stops if fn returns false. |
no outgoing calls