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

This commit is contained in:
JulianChu 2021-02-23 10:34:29 +01:00
parent 2a18e37c4e
commit 59b637db01

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
}