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:
parent
3224990dad
commit
8336c311f8
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user