From 860484a15f578911e2e92b4857a2229f0a257b45 Mon Sep 17 00:00:00 2001 From: Ankit Goyal Date: Sat, 1 Sep 2018 10:56:00 -0700 Subject: [PATCH] strconv: add example for IsGraphic Change-Id: I58ba1f5d5c942d6a345c19df1bca80b63fb5abf5 Reviewed-on: https://go-review.googlesource.com/132777 Reviewed-by: Brad Fitzpatrick --- src/strconv/example_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/strconv/example_test.go b/src/strconv/example_test.go index 5c2e8a9b56..15725456e2 100644 --- a/src/strconv/example_test.go +++ b/src/strconv/example_test.go @@ -167,6 +167,22 @@ func ExampleFormatUint() { // string, 2a } +func ExampleIsGraphic() { + shamrock := strconv.IsGraphic('☘') + fmt.Println(shamrock) + + a := strconv.IsGraphic('a') + fmt.Println(a) + + bel := strconv.IsGraphic('\007') + fmt.Println(bel) + + // Output: + // true + // true + // false +} + func ExampleIsPrint() { c := strconv.IsPrint('\u263a') fmt.Println(c) -- 2.50.0