diff --git a/doc/articles/defer_panic_recover.html b/doc/articles/defer_panic_recover.html index 18c0de2d6c6..9798bedef25 100644 --- a/doc/articles/defer_panic_recover.html +++ b/doc/articles/defer_panic_recover.html @@ -42,7 +42,7 @@ contents of one file to the other: }
-This works, but there is a bug. If the second call to os.Open fails, the +This works, but there is a bug. If the call to os.Create fails, the function will return without closing the source file. This can be easily remedied by putting a call to src.Close() before the second return statement, but if the function were more complex the problem might not be so easily diff --git a/doc/articles/defer_panic_recover.tmpl b/doc/articles/defer_panic_recover.tmpl index 60c8eebe0b3..d2ca7ae2cf3 100644 --- a/doc/articles/defer_panic_recover.tmpl +++ b/doc/articles/defer_panic_recover.tmpl @@ -22,7 +22,7 @@ contents of one file to the other: {{code "progs/defer.go" `/func CopyFile/` `/STOP/`}}
-This works, but there is a bug. If the second call to os.Open fails, the +This works, but there is a bug. If the call to os.Create fails, the function will return without closing the source file. This can be easily remedied by putting a call to src.Close() before the second return statement, but if the function were more complex the problem might not be so easily