aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fmt/example_test.go9
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
+}