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

Function isNewlineEnding

agent/agentfiles/files.go:664–666  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

662// ending class added in one predicate can't silently diverge from
663// the other.
664func 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.

Callers 2

endingsMatchFunction · 0.85
endingShapeEqualFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected