Standard library / bufio

bufio.ErrNegativeCount

Signals an invalid negative discard count. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
var ErrNegativeCount error

Working Example

Example Snippetgo
package main
import (  "bufio"  "fmt"  "strings")
func main() {  r := bufio.NewReader(strings.NewReader("a"))  _, e := r.Discard(-1)  fmt.Println(e == bufio.ErrNegativeCount)}
Go Reference