Standard library / strings

strings.Reader.Size()

Reports the original input byte length, independent of the cursor. Expected stdout: '3\n'.

Formal Syntax & Structure

go syntaxgo
func (r *Reader) Size() int64

Return Value

int64

Reports the original input byte length, independent of the cursor.

Working Example

Example Snippetgo
package main
import (  "fmt"  "strings")
func main() {  r := strings.NewReader("aé")  r.ReadByte()  fmt.Println(r.Size())}
Go Reference