normalizeLineEndings ensures that all line endings are normalized to \n. Required for Windows compatibility.
(content []byte)
| 1747 | // normalizeLineEndings ensures that all line endings are normalized to \n. |
| 1748 | // Required for Windows compatibility. |
| 1749 | func normalizeLineEndings(content []byte) []byte { |
| 1750 | content = bytes.ReplaceAll(content, []byte("\r\n"), []byte("\n")) |
| 1751 | content = bytes.ReplaceAll(content, []byte("\r"), []byte("\n")) |
| 1752 | // some tests generate escaped line endings, so we have to replace them too |
| 1753 | content = bytes.ReplaceAll(content, []byte("\\r\\n"), []byte("\\n")) |
| 1754 | content = bytes.ReplaceAll(content, []byte("\\r"), []byte("\\n")) |
| 1755 | return content |
| 1756 | } |
| 1757 | |
| 1758 | func normalizeGoldenEmail(content []byte) []byte { |
| 1759 | const ( |
no outgoing calls
no test coverage detected