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

io: add error check to WriteString Example test

Change-Id: I9ce1c79e5799f205aec3a4dc02645ed26bdc3581
GitHub-Last-Rev: 59b637db01
GitHub-Pull-Request: golang/go#44533
Reviewed-on: https://go-review.googlesource.com/c/go/+/295389
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
JulianChu 2021-03-13 17:44:10 +00:00 committed by Emmanuel Odeke
parent 3224990dad
commit 8336c311f8

View File

@ -103,7 +103,9 @@ func ExampleReadFull() {
}
func ExampleWriteString() {
io.WriteString(os.Stdout, "Hello World")
if _, err := io.WriteString(os.Stdout, "Hello World"); err != nil {
log.Fatal(err)
}
// Output: Hello World
}