1
0
mirror of https://github.com/golang/go synced 2024-11-12 07:40:23 -07:00

fmt: remove spelling mistake in example

"someting" is misspelled and the error handling both clobbers the
error that occurs and distracts from the point of the example, which
is to demonstrate how Printf works. It's better to just panic with the
error.

Change-Id: I5fb0a4a1a8b4772cbe0302582fa878d95e3a4060
Reviewed-on: https://go-review.googlesource.com/132376
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Kevin Burke 2018-08-30 15:39:45 -06:00
parent 04bee23014
commit 3eb0b2e80d

View File

@ -32,7 +32,7 @@ func ExampleSprintf() {
func ExampleFprintln() {
n, err := fmt.Fprintln(os.Stdout, "there", "are", 99, "gophers")
if err != nil {
panic("failed writing to stdout, someting is seriously wrong")
panic(err)
}
fmt.Print(n)
// Output: