Standard library / strings
strings.Reader.Len()
Reports remaining unread bytes, not total size or rune count. Expected stdout: '2\n'.
Formal Syntax & Structure
go syntaxgo
func (r *Reader) Len() intReturn Value
int
Reports remaining unread bytes, not total size or rune count.
Working Example
Example Snippetgo
package main
import ( "fmt" "strings")
func main() { r := strings.NewReader("aé") r.ReadByte() fmt.Println(r.Len())}