From: Thanabodee Charoenpiriyakij Date: Fri, 7 Sep 2018 12:02:51 +0000 (+0700) Subject: fmt: add example for Sprint X-Git-Tag: go1.12beta1~1137 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7bee8085daa9e8fef7e23c555d72c73ce96d2bfb;p=gostls13.git fmt: add example for Sprint Updates #27376 Change-Id: I9ce6541a95b5ecd13f3932558427de1f597df07a Reviewed-on: https://go-review.googlesource.com/134036 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/fmt/example_test.go b/src/fmt/example_test.go index a09af62757..0ec374d217 100644 --- a/src/fmt/example_test.go +++ b/src/fmt/example_test.go @@ -122,3 +122,12 @@ func ExampleFscanln() { // 3: dmr, 1771, 1.618034 // 3: ken, 271828, 3.141590 } + +func ExampleSprint() { + s := fmt.Sprint("there", "are", "99", "gophers") + fmt.Println(s) + fmt.Println(len(s)) + // Output: + // thereare99gophers + // 17 +}