Commit b1b0b737 authored by Francisco Souza's avatar Francisco Souza Committed by Andrew Gerrand

doc: fixed minor typo in article on defer

Fixes #3176.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5737043
parent f90fd754
...@@ -42,7 +42,7 @@ contents of one file to the other: ...@@ -42,7 +42,7 @@ contents of one file to the other:
}</pre> }</pre>
<p> <p>
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 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, 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 but if the function were more complex the problem might not be so easily
......
...@@ -22,7 +22,7 @@ contents of one file to the other: ...@@ -22,7 +22,7 @@ contents of one file to the other:
{{code "progs/defer.go" `/func CopyFile/` `/STOP/`}} {{code "progs/defer.go" `/func CopyFile/` `/STOP/`}}
<p> <p>
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 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, 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 but if the function were more complex the problem might not be so easily
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment