Golang bufio.WriteByte() function example
package bufio
WriteByte writes a single byte.
Golang bufio.WriteByte() function usage example
package main
import (
"bufio"
"bytes"
"fmt"
)
func main() {
writebuffer := bytes.NewBuffer(nil)
writer := bufio.NewWriter(writebuffer)
writer.WriteByte('G') // write single byte
writer.WriteByte('o') // write another byte
writer.Flush()
fmt.Println(string(writebuffer.Bytes()))
}
Output :
Go
Advertisement
Something interesting
Tutorials
+9.9k Golang : ffmpeg with os/exec.Command() returns non-zero status
+46.5k Golang : Marshal and unmarshal json.RawMessage struct example
+41.9k Golang : How do I convert int to uint8?
+15.6k Chrome : ERR_INSECURE_RESPONSE and allow Chrome browser to load insecure content
+14.5k Golang : Overwrite previous output with count down timer
+22.9k Golang : Gorilla mux routing example
+7.7k Golang : get the current working directory of a running program
+19.1k Mac OSX : Homebrew and Golang
+9.5k Golang : Changing a RGBA image number of channels with OpenCV
+8.1k Golang : How To Use Panic and Recover
+4.9k JQuery : Calling a function inside Jquery(document) block
+7.9k Golang : Get today's weekday name and calculate target day distance example