Standard library / bufio
bufio.Reader.Buffered()
Reports the bytes currently buffered and immediately readable, not the total remaining input. Expected stdout: '3\n'.
Formal Syntax & Structure
go syntaxgo
func (b *Reader) Buffered() intReturn Value
int
Reports the bytes currently buffered and immediately readable, not the total remaining input.
Working Example
Example Snippetgo
package main
import ( "bufio" "fmt" "strings")
func main() { r := bufio.NewReader(strings.NewReader("abc")); r.Peek(1); fmt.Println(r.Buffered()) }