Golang bufio.WriteRune() function example
package bufio
WriteRune writes a single Unicode code point, returning the number of bytes written and any error.
Golang bufio.WriteRune() function usage example
package main
import (
"bufio"
"bytes"
"fmt"
)
func main() {
writebuffer := bytes.NewBuffer(nil)
writer := bufio.NewWriter(writebuffer)
writer.WriteRune('妈')
writer.WriteRune('爸')
writer.WriteRune('好')
writer.Flush()
fmt.Println(string(writebuffer.Bytes()))
}
Output :
妈爸好
Advertisement
Something interesting
Tutorials
+14.4k Golang : Parsing or breaking down URL
+15k Golang : How do I get the local IP (non-loopback) address ?
+7.3k Golang : Of hash table and hash map
+14.4k Golang : On enumeration
+8.6k Python : Fix SyntaxError: Non-ASCII character in file, but no encoding declared
+8.2k Golang : HttpRouter multiplexer routing example
+19.3k Golang : Get RGBA values of each image pixel
+25.6k Golang : convert rune to integer value
+51.4k Golang : Check if item is in slice/array
+22.7k Golang : Round float to precision example
+14.8k Golang : Find commonalities in two slices or arrays example
+13.5k Golang : How to get year, month and day?