Standard library / bufio
bufio.ErrAdvanceTooFar
Signals a split function tried to consume more bytes than supplied. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
var ErrAdvanceTooFar errorWorking Example
Example Snippetgo
package main
import ( "bufio" "fmt" "strings")
func main() { s := bufio.NewScanner(strings.NewReader("a")) s.Split(func([]byte, bool) (int, []byte, error) { return 2, nil, nil }) s.Scan() fmt.Println(s.Err() == bufio.ErrAdvanceTooFar)}