csv

package
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2025 License: Apache-2.0, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser is a CSV reader that only counts fields. It avoids allocating/copying memory and to verify behaviour, it is tested and fuzzed against encoding/csv parser.

func NewParser

func NewParser(comma, comment byte, s scan.Bytes) *Parser

func (*Parser) CountFields

func (r *Parser) CountFields(collectIndexes bool) (fields int, fieldPos []int, hasMore bool)

CountFields reads one CSV line and counts how many records that line contained. hasMore reports whether there are more lines in the input. collectIndexes makes CountFields return a list of indexes where CSV fields start in the line. These indexes are used to test the correctness against the encoding/csv parser.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL