isNewlineEnding reports whether s is one of the newline-class endings: "\n" or "\r\n". Shared primitive for endingsMatch (matching phase) and endingShapeEqual (splice phase) so a new ending class added in one predicate can't silently diverge from the other.
(s string)
| 662 | // ending class added in one predicate can't silently diverge from |
| 663 | // the other. |
| 664 | func isNewlineEnding(s string) bool { |
| 665 | return s == "\n" || s == "\r\n" |
| 666 | } |
| 667 | |
| 668 | // internalLineEnding returns the shared line ending used across |
| 669 | // lines. An unterminated last line (EOF-no-newline) is excluded. |
no outgoing calls
no test coverage detected