MCPcopy Create free account
hub / github.com/dolthub/doltgresql / lengthNL

Function lengthNL

core/dataloader/csvreader.go:145–150  ·  view source on GitHub ↗

Functions below this line are borrowed or adapted from encoding/csv/reader.go lengthNL returns 1 if the last byte in b is a newline, 0 otherwise.

(b []byte)

Source from the content-addressed store, hash-verified

143
144// lengthNL returns 1 if the last byte in b is a newline, 0 otherwise.
145func lengthNL(b []byte) int {
146 if len(b) > 0 && b[len(b)-1] == '\n' {
147 return 1
148 }
149 return 0
150}
151
152// readLine reads the next line (with the trailing endline).
153// If EOF is hit without a trailing endline, it will be omitted.

Callers 4

readLineMethod · 0.85
csvReadRecordsMethod · 0.85
parseFieldMethod · 0.85
parseQuotedFieldMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected