Commit 121b428a authored by Rob Pike's avatar Rob Pike

effective go: update to new Open signature.

Fixes #1788.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/4519042
parent 8bf15158
...@@ -504,7 +504,7 @@ the body ends in <code>break</code>, <code>continue</code>, ...@@ -504,7 +504,7 @@ the body ends in <code>break</code>, <code>continue</code>,
</p> </p>
<pre> <pre>
f, err := os.Open(name, os.O_RDONLY, 0) f, err := os.Open(name)
if err != nil { if err != nil {
return err return err
} }
...@@ -520,7 +520,7 @@ statements, the resulting code needs no <code>else</code> statements. ...@@ -520,7 +520,7 @@ statements, the resulting code needs no <code>else</code> statements.
</p> </p>
<pre> <pre>
f, err := os.Open(name, os.O_RDONLY, 0) f, err := os.Open(name)
if err != nil { if err != nil {
return err return err
} }
...@@ -813,7 +813,7 @@ canonical examples are unlocking a mutex or closing a file. ...@@ -813,7 +813,7 @@ canonical examples are unlocking a mutex or closing a file.
<pre> <pre>
// Contents returns the file's contents as a string. // Contents returns the file's contents as a string.
func Contents(filename string) (string, os.Error) { func Contents(filename string) (string, os.Error) {
f, err := os.Open(filename, os.O_RDONLY, 0) f, err := os.Open(filename)
if err != nil { if err != nil {
return "", err return "", err
} }
...@@ -2675,7 +2675,7 @@ field for recoverable failures. ...@@ -2675,7 +2675,7 @@ field for recoverable failures.
<pre> <pre>
for try := 0; try &lt; 2; try++ { for try := 0; try &lt; 2; try++ {
file, err = os.Open(filename, os.O_RDONLY, 0) file, err = os.Open(filename)
if err == nil { if err == nil {
return return
} }
......
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