diff options
author | Thanabodee Charoenpiriyakij <wingyminus@gmail.com> | 2018-09-07 19:02:51 +0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2018-09-07 12:32:06 +0000 |
commit | 7bee8085daa9e8fef7e23c555d72c73ce96d2bfb (patch) | |
tree | e3eb3a567676599af9a333c33f5bceaff5e39edf /src/fmt | |
parent | b7182acf6101ba096a25073d8d083cca99ffcd06 (diff) | |
download | go-7bee8085daa9e8fef7e23c555d72c73ce96d2bfb.tar.gz go-7bee8085daa9e8fef7e23c555d72c73ce96d2bfb.zip |
fmt: add example for Sprint
Updates #27376
Change-Id: I9ce6541a95b5ecd13f3932558427de1f597df07a
Reviewed-on: https://go-review.googlesource.com/134036
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/fmt')
-rw-r--r-- | src/fmt/example_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
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 +} |