From 622d729b86bbc0b0b1b31903df4504e22b4dfaac Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 1 Feb 2011 21:09:33 -0800 Subject: [PATCH] io: add ReadRuner Put it in the same package as ReadByter. There is no implementation here for either interface. R=rsc CC=golang-dev https://golang.org/cl/4121051 --- src/pkg/io/io.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pkg/io/io.go b/src/pkg/io/io.go index 1a6eca95a0..b88c213c81 100644 --- a/src/pkg/io/io.go +++ b/src/pkg/io/io.go @@ -158,6 +158,15 @@ type ReadByter interface { ReadByte() (c byte, err os.Error) } +// ReadRuner is the interface that wraps the ReadRune method. +// +// ReadRune reads a single UTF-8 encoded Unicode character +// and returns the rune and its size in bytes. If no character is +// available, err will be set. +type ReadRuner interface { + ReadRune() (rune int, size int, err os.Error) +} + // WriteString writes the contents of the string s to w, which accepts an array of bytes. func WriteString(w Writer, s string) (n int, err os.Error) { return w.Write([]byte(s)) -- 2.48.1