Documentation ¶
Overview ¶
Package repeat implements the repeat-reader. A repeat-reader outputs a given constant byte sequence repeatedly.
This package was originally written for testing and profiling parsers. A typical use may look something like this:
input := "some line to be parsed\n" r := NewReader([]byte(input), 1000) parser := myparse.NewParser(r) (start profiling) // Parse 1000 lines until non-nil error. for parser.ParseNext() == nil {} (stop profiling)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader outputs a given constant byte sequence repeatedly.
func NewReader ¶
NewReader returns a reader that outputs data n times. If n is negative, repeats infinitely. Copies the contents of data.
Click to show internal directories.
Click to hide internal directories.