Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner presents the same interface as bufio.Scanner except it scans tokens in reverse from the end of a file instead of forwards from the beginning.
It may not work correctly if the split function can return an error from reading half way through a token. That is not the case for any of the Scan* functions in bufio.
func NewScanner ¶
func NewScanner(r io.ReadSeeker) *Scanner
NewScanner returns a new Scanner to read tokens in reverse from r. The split function defaults to bufio.ScanLines.
func (*Scanner) Bytes ¶
Bytes returns the most recent token generated by a call to Scan. The underlying array may point to data that will be overwritten by a subsequent call to Scan. It does no allocation.
func (*Scanner) Scan ¶
Scan advances the Scanner to the next token, which will then be available through the Bytes or Text method. It returns false when the scan stops, either by reaching the end of the input or an error. After Scan returns false, the Err method will return any error that occurred during scanning, except that if it was io.EOF, Err will return nil.