]> Cypherpunks repositories - gostls13.git/commitdiff
fmt: add example for Sprint
authorThanabodee Charoenpiriyakij <wingyminus@gmail.com>
Fri, 7 Sep 2018 12:02:51 +0000 (19:02 +0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 7 Sep 2018 12:32:06 +0000 (12:32 +0000)
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>
src/fmt/example_test.go

index a09af62757911db600b328721b6b107cf4565a4f..0ec374d217213c327815c819d78edba2b2ef7a06 100644 (file)
@@ -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
+}