Standard library / bufio

bufio.Reader

Buffered input wrapper; may read ahead, so avoid mixing underlying reads with buffered reads. Expected stdout: 'abc\n'.

Formal Syntax & Structure

go syntaxgo
type Reader struct { /* unexported fields */ }

Working Example

Example Snippetgo
package main
import (  "bufio"  "fmt"  "strings")
func main() {  var r *bufio.Reader = bufio.NewReader(strings.NewReader("abc"))  s, _ := r.ReadString('\n')  fmt.Println(s)}
Go Reference