Standard library / bufio
bufio.Writer
Buffered output wrapper; errors may be delayed until Flush. A successful Flush does not guarantee durable storage. Expected stdout: 'ok\n'.
Formal Syntax & Structure
go syntaxgo
type Writer struct { /* unexported fields */ }Working Example
Example Snippetgo
package main
import ( "bufio" "bytes" "fmt")
func main() { var b bytes.Buffer var w *bufio.Writer = bufio.NewWriter(&b) w.WriteString("ok") if e := w.Flush(); e != nil { panic(e) } fmt.Println(b.String())}