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
+5.9k Golang : Use NLP to get sentences for each paragraph example
+18.7k Golang : convert int to string
+8k Golang : Sort words with first uppercase letter
+14.4k Golang : On enumeration
+10k Golang : Setting variable value with ldflags
+13.1k Golang : How to get a user home directory path?
+6.4k PHP : Proper way to get UTF-8 character or string length
+17.6k Golang : delete and modify XML file content
+7.8k Golang : Example of how to detect which type of script a word belongs to
+29.5k Golang : How to create new XML file ?
+12.1k Golang : Split strings into command line arguments
+20k Golang : How to run your code only once with sync.Once object