Documentation
¶
Overview ¶
Package lines splits inputs into lines and represents each line by its boundaries: offsets into the input.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lines ¶
type Lines struct {
// contains filtered or unexported fields
}
Lines holds an input and its line boundaries. Each line includes its newline character.
func Split ¶
Split returns the lines of s. The result must only be used while s is not modified. Call Lines.Release when the result is no longer needed.
func SplitPair ¶
SplitPair returns the lines of x and y and the number of lines in their longest common prefix and suffix. The prefix and suffix don't overlap. The results must only be used while x and y are not modified. Call Lines.Release on both results when they are no longer needed.
func (*Lines) At ¶
At returns line i like Lines.Line, but without computing its boundaries, so that it inlines. Line i must be one whose boundaries are always computed: any line of Split, or a line between the common prefix and suffix of SplitPair.
func (*Lines) Release ¶
func (l *Lines) Release()
Release returns the memory of l to a pool. The caller must not use l after Release.