go1.20.5
GoThrough

bufio.MaxScanTokenSize

// MaxScanTokenSize is the maximum size used to buffer a token // unless the user provides an explicit buffer with Scanner.Buffer. // The actual maximum token size may be smaller as the buffer // may need to include, for instance, a newline. const MaxScanTokenSize = 64 * 1024

bufio.ErrAdvanceTooFar

// Errors returned by Scanner. var ErrAdvanceTooFar = errors.New("bufio.Scanner: SplitFunc returns advance count beyond input")

bufio.ErrBadReadCount

// Errors returned by Scanner. var ErrBadReadCount = errors.New("bufio.Scanner: Read returned impossible count")

bufio.ErrBufferFull

var ErrBufferFull = errors.New("bufio: buffer full")

bufio.ErrFinalToken

// ErrFinalToken is a special sentinel error value. It is intended to be // returned by a Split function to indicate that the token being delivered // with the error is the last token and scanning should stop after this one. // After ErrFinalToken is received by Scan, scanning stops with no error. // The value is useful to stop processing early or when it is necessary to // deliver a final empty token. One could achieve the same behavior // with a custom error value but providing one here is tidier. // See the emptyFinalToken example for a use of this value. var ErrFinalToken = errors.New("final token")

bufio.ErrInvalidUnreadByte

var ErrInvalidUnreadByte = errors.New("bufio: invalid use of UnreadByte")

bufio.ErrInvalidUnreadRune

var ErrInvalidUnreadRune = errors.New("bufio: invalid use of UnreadRune")

bufio.ErrNegativeAdvance

// Errors returned by Scanner. var ErrNegativeAdvance = errors.New("bufio.Scanner: SplitFunc returns negative advance count")

bufio.ErrNegativeCount

var ErrNegativeCount = errors.New("bufio: negative count")

bufio.ErrTooLong

// Errors returned by Scanner. var ErrTooLong = errors.New("bufio.Scanner: token too long")

bufio.NewReadWriter

// NewReadWriter allocates a new ReadWriter that dispatches to r and w. func NewReadWriter(r *Reader, w *Writer) *ReadWriter

bufio.NewReader

// NewReader returns a new Reader whose buffer has the default size. func NewReader(rd io.Reader) *Reader

bufio.NewReaderSize

// NewReaderSize returns a new Reader whose buffer has at least the specified // size. If the argument io.Reader is already a Reader with large enough // size, it returns the underlying Reader. func NewReaderSize(rd io.Reader, size int) *Reader

bufio.NewScanner

// NewScanner returns a new Scanner to read from r. // The split function defaults to ScanLines. func NewScanner(r io.Reader) *Scanner

bufio.NewWriter

// NewWriter returns a new Writer whose buffer has the default size. // If the argument io.Writer is already a Writer with large enough buffer size, // it returns the underlying Writer. func NewWriter(w io.Writer) *Writer

bufio.NewWriterSize

// NewWriterSize returns a new Writer whose buffer has at least the specified // size. If the argument io.Writer is already a Writer with large enough // size, it returns the underlying Writer. func NewWriterSize(w io.Writer, size int) *Writer

bufio.ScanBytes

// ScanBytes is a split function for a Scanner that returns each byte as a token. func ScanBytes(data []byte, atEOF bool) (advance int, token []byte, err error)

bufio.ScanLines

// ScanLines is a split function for a Scanner that returns each line of // text, stripped of any trailing end-of-line marker. The returned line may // be empty. The end-of-line marker is one optional carriage return followed // by one mandatory newline. In regular expression notation, it is `\r?\n`. // The last non-empty line of input will be returned even if it has no // newline. func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error)

bufio.ScanRunes

// ScanRunes is a split function for a Scanner that returns each // UTF-8-encoded rune as a token. The sequence of runes returned is // equivalent to that from a range loop over the input as a string, which // means that erroneous UTF-8 encodings translate to U+FFFD = "\xef\xbf\xbd". // Because of the Scan interface, this makes it impossible for the client to // distinguish correctly encoded replacement runes from encoding errors. func ScanRunes(data []byte, atEOF bool) (advance int, token []byte, err error)

bufio.ScanWords

// ScanWords is a split function for a Scanner that returns each // space-separated word of text, with surrounding spaces deleted. It will // never return an empty string. The definition of space is set by // unicode.IsSpace. func ScanWords(data []byte, atEOF bool) (advance int, token []byte, err error)