Standard library / strings
strings.Reader.ReadByte()
Reads one byte and advances the cursor; returns io.EOF when exhausted. Expected stdout: '97 <nil>\n'.
Formal Syntax & Structure
go syntaxgo
func (r *Reader) ReadByte() (byte, error)Return Value
(byte, error)
Reads one byte and advances the cursor; returns io.EOF when exhausted.
Working Example
Example Snippetgo
package main
import ( "fmt" "strings")
func main() { r := strings.NewReader("aé") b, e := r.ReadByte() fmt.Println(b, e)}