MCPcopy Create free account
hub / github.com/brimdata/super / isCSVStream

Function isCSVStream

sio/anyio/reader.go:177–185  ·  view source on GitHub ↗
(track *Track, delim rune, name string)

Source from the content-addressed store, hash-verified

175}
176
177func isCSVStream(track *Track, delim rune, name string) error {
178 if line, err := bufio.NewReader(track).ReadSlice('\n'); err != nil {
179 return fmt.Errorf("%s: line 1: %w", name, err)
180 } else if !bytes.ContainsRune(line, delim) {
181 return fmt.Errorf("%s: line 1: delimiter %q not found", name, delim)
182 }
183 track.Reset()
184 return match(csvio.NewReader(super.NewContext(), track, csvio.ReaderOpts{Delim: delim}), name, 1)
185}
186
187func joinErrs(errs []error) error {
188 var b strings.Builder

Callers 1

NewReaderFunction · 0.85

Calls 5

NewReaderFunction · 0.92
NewContextFunction · 0.92
matchFunction · 0.85
NewReaderMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected