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
+39.6k Golang : Remove dashes(or any character) from string
+16.9k Golang : Get the IPv4 and IPv6 addresses for a specific network interface
+7k Golang : Levenshtein distance example
+10.1k Golang : Get login name from environment and prompt for password
+31.6k Golang : Get local IP and MAC address
+9k Golang : Build and compile multiple source files
+5.4k Golang *File points to a file or directory ?
+12.8k Golang : Convert int(year) to time.Time type
+7.9k Golang : How to feed or take banana with Gorilla Web Toolkit Session package
+7.9k Setting $GOPATH environment variable for Unix/Linux and Windows
+4.6k JavaScript : Rounding number to decimal formats to display currency
+7.7k Golang : Generate human readable password