Commit 58e970ed authored by Drew Flower's avatar Drew Flower Committed by Brad Fitzpatrick

fmt: add an example for Sprintln

Change-Id: I0fcb5e626bf3d6891592c21b912c824743d7eaa0
Reviewed-on: https://go-review.googlesource.com/132280Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 677c4acc
......@@ -40,6 +40,14 @@ func ExamplePrintln() {
// 21
}
func ExampleSprintln() {
s := "Aug"
sl := fmt.Sprintln("Today is 30", s)
fmt.Printf("%q", sl)
// Output:
// "Today is 30 Aug\n"
}
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