From a0aac8c18348bc987a99694d391e5e3a85a14d71 Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Tue, 10 Jul 2018 20:43:45 -0700 Subject: [PATCH] utf8s.RuneReader docs --- README.md | 12 ++++++++++++ doc.go | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/README.md b/README.md index 2b89016..83eade1 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,15 @@ var r rune n, err := utf8s.WriteRune(w, r) ``` + +```go +var reader io.Reader + +// ... + +runeReader := utf8s.NewRuneReader(reader) + +// ... + +r, n, err := runeReader.ReadRune() +``` diff --git a/doc.go b/doc.go index 08ad705..5d27868 100644 --- a/doc.go +++ b/doc.go @@ -24,6 +24,19 @@ Example n, err := utf8s.WriteRune(w, r) +Example + + var reader io.Reader + + // ... + + runeReader := utf8s.NewRuneReader(reader) + + // .. + + r, n, err := runeReader.ReadRune() + + Example var r rune