Golang bytes.Buffer.ReadByte() function example
package bytes
ReadByte reads and returns the next byte from the buffer. If no byte is available, it returns error io.EOF.
Golang bytes.Buffer.ReadByte() function usage example
package main
import (
"bytes"
"fmt"
)
func main() {
buff := bytes.NewBufferString("abcdef")
rb, err := buff.ReadByte()
fmt.Printf("%v %d %s\n", err, rb, string(rb))
}
Output :
97 a
Reference :
Advertisement
Something interesting
Tutorials
+22.7k Golang : Set and Get HTTP request headers example
+51.9k Golang : How to get time in milliseconds?
+17k Golang : Covert map/slice/array to JSON or XML format
+12.3k Golang : How to check if a string starts or ends with certain characters or words?
+6.3k Golang : How to get capacity of a slice or array?
+7k Golang : Levenshtein distance example
+16.9k Golang : Get the IPv4 and IPv6 addresses for a specific network interface
+16.9k Golang : How to generate QR codes?
+8.8k Golang : Gorilla web tool kit schema example
+5.9k Golang : Shuffle array of list