Skip to content

Commit 8a2b5f1

Browse files
dgrmshgriesemer
authored andcommitted
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/132284 Reviewed-by: Robert Griesemer <[email protected]>
1 parent 58e970e commit 8a2b5f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/go_spec.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--{
22
"Title": "The Go Programming Language Specification",
3-
"Subtitle": "Version of May 9, 2018",
3+
"Subtitle": "Version of August 30, 2018",
44
"Path": "/ref/spec"
55
}-->
66

@@ -2112,8 +2112,8 @@ <h3 id="Short_variable_declarations">Short variable declarations</h3>
21122112
i, j := 0, 10
21132113
f := func() int { return 7 }
21142114
ch := make(chan int)
2115-
r, w := os.Pipe(fd) // os.Pipe() returns two values
2116-
_, y, _ := coord(p) // coord() returns three values; only interested in y coordinate
2115+
r, w, _ := os.Pipe() // os.Pipe() returns a connected pair of Files and an error, if any
2116+
_, y, _ := coord(p) // coord() returns three values; only interested in y coordinate
21172117
</pre>
21182118

21192119
<p>

0 commit comments

Comments
 (0)