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
+10.8k Golang : Replace a parameter's value inside a configuration file example
+26.6k Golang : Find files by extension
+13.1k CodeIgniter : "Fatal error: Cannot use object of type stdClass as array" message
+26.4k Golang : Encrypt and decrypt data with AES crypto
+11.5k Golang : Convert(cast) float to int
+11.4k Golang : Change date format to yyyy-mm-dd
+9.3k Facebook : Getting the friends list with PHP return JSON format
+37.5k Golang : Comparing date or timestamp
+16.8k Golang : How to save log messages to file?
+7.9k Golang : Handle Palindrome string with case sensitivity and unicode
+12.5k Golang : zlib compress file example