Commit 8a2b5f1f authored by Dina Garmash's avatar Dina Garmash Committed by Robert Griesemer

doc: fix os.Pipe() call in the example.

Short variable declarations example passes an fd argument to os.Pipe call.
However, os.Pipe() takes no arguments and returns 2 Files and an error:
https://golang.org/src/os/pipe_linux.go?s=319:360#L1

Fixes: #27384

Change-Id: I0a709f51e0878c57185d901b899d209f001dfcce
Reviewed-on: https://go-review.googlesource.com/132284Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
parent 58e970ed
<!--{ <!--{
"Title": "The Go Programming Language Specification", "Title": "The Go Programming Language Specification",
"Subtitle": "Version of May 9, 2018", "Subtitle": "Version of August 30, 2018",
"Path": "/ref/spec" "Path": "/ref/spec"
}--> }-->
...@@ -2112,7 +2112,7 @@ with initializer expressions but no types: ...@@ -2112,7 +2112,7 @@ with initializer expressions but no types:
i, j := 0, 10 i, j := 0, 10
f := func() int { return 7 } f := func() int { return 7 }
ch := make(chan int) ch := make(chan int)
r, w := os.Pipe(fd) // os.Pipe() returns two values r, w, _ := os.Pipe() // os.Pipe() returns a connected pair of Files and an error, if any
_, y, _ := coord(p) // coord() returns three values; only interested in y coordinate _, y, _ := coord(p) // coord() returns three values; only interested in y coordinate
</pre> </pre>
......
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