From: Francisco Souza Date: Sun, 4 Mar 2012 00:34:21 +0000 (+1100) Subject: doc: fixed minor typo in article on defer X-Git-Tag: weekly.2012-03-04~14 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b1b0b73738b4966a6d8f497d5ede03a6a51ee110;p=gostls13.git doc: fixed minor typo in article on defer Fixes #3176. R=golang-dev, adg CC=golang-dev https://golang.org/cl/5737043 --- diff --git a/doc/articles/defer_panic_recover.html b/doc/articles/defer_panic_recover.html index 18c0de2d6c..9798bedef2 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 60c8eebe0b..d2ca7ae2cf 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