MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / lengthCRLF

Function lengthCRLF

pkg/util/encoding/csv/reader.go:251–259  ·  view source on GitHub ↗

lengthCRLF reports the number of bytes for a trailing "\r\n".

(b []byte)

Source from the content-addressed store, hash-verified

249
250// lengthCRLF reports the number of bytes for a trailing "\r\n".
251func lengthCRLF(b []byte) int {
252 if j := len(b) - 1; j >= 0 && b[j] == '\n' {
253 if j := len(b) - 2; j >= 0 && b[j] == '\r' {
254 return 2
255 }
256 return 1
257 }
258 return 0
259}
260
261// nextRune returns the next rune in b or utf8.RuneError.
262func nextRune(b []byte) rune {

Callers 1

readRecordMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…