diff --git a/src/fmt/example_test.go b/src/fmt/example_test.go index 6aeee03e43..a09af62757 100644 --- a/src/fmt/example_test.go +++ b/src/fmt/example_test.go @@ -49,6 +49,17 @@ func ExampleSprintf() { // 15 } +func ExamplePrint() { + n, err := fmt.Print("there", "are", 99, "gophers", "\n") + if err != nil { + panic(err) + } + fmt.Print(n) + // Output: + // thereare99gophers + // 18 +} + func ExamplePrintln() { n, err := fmt.Println("there", "are", 99, "gophers") if err != nil {