Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
dc60c5a7
Commit
dc60c5a7
authored
Jul 14, 2010
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go spec: clarification of channel close()
R=r, rsc CC=golang-dev
https://golang.org/cl/1766042
parent
708d7160
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
go_spec.html
doc/go_spec.html
+10
-7
No files found.
doc/go_spec.html
View file @
dc60c5a7
<!-- title The Go Programming Language Specification -->
<!-- title The Go Programming Language Specification -->
<!-- subtitle Version of July 1
2
, 2010 -->
<!-- subtitle Version of July 1
4
, 2010 -->
<!--
<!--
TODO
TODO
...
@@ -4347,14 +4347,17 @@ BuiltinArgs = Type [ "," ExpressionList ] | ExpressionList .
...
@@ -4347,14 +4347,17 @@ BuiltinArgs = Type [ "," ExpressionList ] | ExpressionList .
<h3
id=
"Close_and_closed"
>
Close and closed
</h3>
<h3
id=
"Close_and_closed"
>
Close and closed
</h3>
<p>
<p>
For a channel
<code>
c
</code>
, the predefined function
<code>
close(c)
</code>
For a channel
<code>
c
</code>
, the built-in function
<code>
close(c)
</code>
marks the channel as unable to accept more
marks the channel as unable to accept more values through a send operation;
values through a send operation. After any previously
values sent to a closed channed are ignored.
After calling
<code>
close
</code>
, and after any previously
sent values have been received, receive operations will return
sent values have been received, receive operations will return
the zero value for the channel's type. After at least one such zero value has been
the zero value for the channel's type without blocking.
After at least one such zero value has been
received,
<code>
closed(c)
</code>
returns true.
received,
<code>
closed(c)
</code>
returns true.
</p>
</p>
<h3
id=
"Length_and_capacity"
>
Length and capacity
</h3>
<h3
id=
"Length_and_capacity"
>
Length and capacity
</h3>
<p>
<p>
...
@@ -4560,10 +4563,10 @@ func recover() interface{}
...
@@ -4560,10 +4563,10 @@ func recover() interface{}
</pre>
</pre>
<p>
<p>
<
font
color=
red
>
TODO: Most of this text could move to the respective
<
span
class=
"alert"
>
TODO: Most of this text could move to the respective
comments in
<code>
runtime.go
</code>
once the functions are implemented.
comments in
<code>
runtime.go
</code>
once the functions are implemented.
They are here, at least for now, for reference and discussion.
They are here, at least for now, for reference and discussion.
</
font
>
</
span
>
</p>
</p>
<p>
<p>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment