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
+24.2k Golang : Change file read or write permission example
+4.1k Golang : Converting individual Jawi alphabet to Rumi(Romanized) alphabet example
+20.2k Golang : Pipe output from one os.Exec(shell command) to another command
+24.7k Golang : Generate MD5 checksum of a file
+10.6k Golang : Command line file upload program to server example
+9k Golang : Temperatures conversion example
+8.3k Android Studio : Import third-party library or package into Gradle Scripts
+18.3k Golang : Generate thumbnails from images
+15.2k Golang : Force download file example
+11.2k Golang : Find age or leap age from date of birth example