shad-go/lectures/10-io/bytesbuffer/main.go
2022-04-21 01:22:13 +03:00

14 lines
211 B
Go

package main
import (
"bytes"
"fmt"
"os"
)
func main() {
var b bytes.Buffer // A Buffer needs no initialization.
b.Write([]byte("Hello "))
_, _ = fmt.Fprintf(&b, "world!")
_, _ = b.WriteTo(os.Stdout)
}