From b7182acf6101ba096a25073d8d083cca99ffcd06 Mon Sep 17 00:00:00 2001 From: Thanabodee Charoenpiriyakij Date: Fri, 7 Sep 2018 18:52:41 +0700 Subject: [PATCH] fmt: add example for Print Updates #27376 Change-Id: I2fa63b0d1981a419626072d985e6f3326f6013ff Reviewed-on: https://go-review.googlesource.com/134035 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/fmt/example_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 { -- 2.50.0