linesplit

package
v0.0.0-...-fefa08e Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2018 License: 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 Splitter

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

Splitter provides a lineSplit function that will split records on unix, DOS, inverted DOS (/n/r) or bare carriage return (/r) terminators. Splitter emits certain information about the status of the splitter, such as the most recently read record, terminator, terminator length, etc...

func (*Splitter) CurrentTerminator

func (l *Splitter) CurrentTerminator() []byte

CurrentTerminator returns the terminator that was most recently identified by the splitter. This value will be nil if no data was returned in the most recent Split. This value will be an empty slice if data was returned, but contained no terminator. Otherwise, if a terminator was identified within the slice, that terminator is returned.

func (*Splitter) Split

func (l *Splitter) Split(data []byte, atEOF bool) (advance int, token []byte, err error)

Split performs the line splitting operations.

Jump to

Keyboard shortcuts

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