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
+7.4k Golang : Hue, Saturation and Value(HSV) with OpenCV example
+21.5k Golang : How to read float value from standard input ?
+11.1k Golang : How to determine a prime number?
+8.2k Golang : Routes multiplexer routing example with regular expression control
+10.4k Golang : Generate random integer or float number
+13.9k Golang : Human readable time elapsed format such as 5 days ago
+5.2k Python : Create Whois client or function example
+8.2k Golang : Find relative luminance or color brightness
+16.4k Golang : Send email and SMTP configuration example
+4.6k Mac OSX : Get disk partitions' size, type and name
+6.2k Linux/Unix : Commands that you need to be careful about
+18.6k Golang : Iterating Elements Over A List