From 9acec1ea30c518925c26d598e07f55a5fab14e9e Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Mon, 2 Jul 2018 11:28:12 -0700 Subject: [PATCH] added more docs --- len.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/len.go b/len.go index 3e8f34b..e1e68e1 100644 --- a/len.go +++ b/len.go @@ -1,6 +1,30 @@ package utf8s // Len returns the number of bytes in a UTF-8 encoding of this Unicode code point. +// +// Example +// +// length := utf8s.Len('A') +// +// // length == 1 +// +// Example +// +// length := utf8s.Len('r') +// +// // length == 1 +// +// Example +// +// length := utf8s.Len('¡') +// +// // length == 2 +// +// Example +// +// length := utf8s.Len('۵') +// +// // length == 2 func Len(r rune) int { switch {