diff --git a/src/io/example_test.go b/src/io/example_test.go index 6d338acd14..a18df9feff 100644 --- a/src/io/example_test.go +++ b/src/io/example_test.go @@ -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 }