MCPcopy Index your code
hub / github.com/coder/coder / normalizeLineEndings

Function normalizeLineEndings

coderd/notifications/notifications_test.go:1749–1756  ·  view source on GitHub ↗

normalizeLineEndings ensures that all line endings are normalized to \n. Required for Windows compatibility.

(content []byte)

Source from the content-addressed store, hash-verified

1747// normalizeLineEndings ensures that all line endings are normalized to \n.
1748// Required for Windows compatibility.
1749func 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
1758func normalizeGoldenEmail(content []byte) []byte {
1759 const (

Callers 2

normalizeGoldenWebhookFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected