mirror of
https://github.com/golang/go
synced 2024-11-25 00:57:59 -07:00
doc: fixed minor typo in article on defer
Fixes #3176. R=golang-dev, adg CC=golang-dev https://golang.org/cl/5737043
This commit is contained in:
parent
f90fd754e3
commit
b1b0b73738
@ -42,7 +42,7 @@ contents of one file to the other:
|
||||
}</pre>
|
||||
|
||||
<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
|
||||
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
|
||||
|
@ -22,7 +22,7 @@ contents of one file to the other:
|
||||
{{code "progs/defer.go" `/func CopyFile/` `/STOP/`}}
|
||||
|
||||
<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
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user