Golang bufio.NewWriter function example
package bufio
NewWriter returns a new Writer whose buffer has the default size.
Golang bufio.NewWriter function usage example
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
screenWriter := bufio.NewWriter(os.Stdout)
fmt.Fprint(screenWriter, "Hello, ")
fmt.Fprint(screenWriter, "world! 你好世界!\n")
screenWriter.Flush() // Don't forget to flush!
}
Output :
Hello, world! 你好世界!
Reference :
Advertisement
Something interesting
Tutorials
+38.2k Golang : Read a text file and replace certain words
+12.8k Golang : Remove or trim extra comma from CSV
+32.3k Golang : Validate email address with regular expression
+42.1k Golang : How do I convert int to uint8?
+5.1k Golang : Check if a word is countable or not
+8.4k Golang : Convert word to its plural form example
+7.6k Golang : Rename part of filename
+17.8k Golang : delete and modify XML file content
+11.8k Golang : Verify Linux user password again before executing a program example
+23k Golang : Gorilla mux routing example
+6.9k Android Studio : Hello World example
+9.7k Golang : Eroding and dilating image with OpenCV example