Golang bufio.WriteTo() function example
package bufio
WriteTo implements io.WriterTo interface
Golang bufio.WriteTo() function usage example
package main
import (
"bytes"
"bufio"
"os"
)
func main() {
readbuffer := bytes.NewBuffer([]byte("Hello "))
reader := bufio.NewReader(readbuffer)
readbuffer.Write([]byte("World 你好 世界! \n "))
reader.WriteTo(os.Stdout) // print out the screen with WriteTo
}
Output :
Hello World 你好 世界!
Reference :
Advertisement
Something interesting
Tutorials
+7.8k Golang : Scan files for certain pattern and rename part of the files
+11.6k Golang : Convert(cast) float to int
+52.6k Golang : How to get struct field and value by name
+10.9k Golang : Sieve of Eratosthenes algorithm
+28k Golang : Move file to another directory
+43.2k Golang : Convert []byte to image
+5.9k Facebook : How to force facebook to scrape latest URL link data?
+17.6k Golang : delete and modify XML file content
+15.3k Golang : Get query string value on a POST request
+8.9k Golang : Gaussian blur on image and camera video feed examples
+4.3k Golang : Converting individual Jawi alphabet to Rumi(Romanized) alphabet example
+10.8k Golang : Command line file upload program to server example