Commit eeb2a11e authored by Rodolfo Rodriguez's avatar Rodolfo Rodriguez Committed by Ian Lance Taylor

fmt: add Println example

Change-Id: Ifd509c0c6a6ea41094b6ae1f4931414325b152fd
Reviewed-on: https://go-review.googlesource.com/132475
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 770e37d2
......@@ -29,6 +29,17 @@ func ExampleSprintf() {
// 15
}
func ExamplePrintln() {
n, err := fmt.Println("there", "are", 99, "gophers")
if err != nil {
panic(err)
}
fmt.Print(n)
// Output:
// there are 99 gophers
// 21
}
func ExampleFprintln() {
n, err := fmt.Fprintln(os.Stdout, "there", "are", 99, "gophers")
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment