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
d5537076
Commit
d5537076
authored
Aug 22, 2009
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow "comma ok" in initializers
DELTA=11 (4 added, 0 deleted, 7 changed) OCL=33698 CL=33712
parent
28b655ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
go_spec.html
doc/go_spec.html
+8
-4
No files found.
doc/go_spec.html
View file @
d5537076
...
@@ -2160,12 +2160,13 @@ an otherwise legal index expression, a run-time exception occurs.
...
@@ -2160,12 +2160,13 @@ an otherwise legal index expression, a run-time exception occurs.
<p>
<p>
However, if an index expression on a map
<code>
a
</code>
of type
<code>
map[K] V
</code>
However, if an index expression on a map
<code>
a
</code>
of type
<code>
map[K] V
</code>
is used in an assignment o
f one of the special forms
is used in an assignment o
r initialization of the form
</p>
</p>
<pre>
<pre>
r, ok = a[x]
r, ok = a[x]
r, ok := a[x]
r, ok := a[x]
var r, ok = a[x]
</pre>
</pre>
<p>
<p>
...
@@ -2262,12 +2263,13 @@ is known only at run-time, the type of <code>x.(T)</code> is
...
@@ -2262,12 +2263,13 @@ is known only at run-time, the type of <code>x.(T)</code> is
known to be
<code>
T
</code>
in a correct program.
known to be
<code>
T
</code>
in a correct program.
</p>
</p>
<p>
<p>
If a type assertion is used in an assignment o
f one of the special forms,
If a type assertion is used in an assignment o
r initialization of the form
</p>
</p>
<pre>
<pre>
v, ok = x.(T)
v, ok = x.(T)
v, ok := x.(T)
v, ok := x.(T)
var v, ok = x.(T)
</pre>
</pre>
<p>
<p>
...
@@ -2851,11 +2853,13 @@ f(<-ch)
...
@@ -2851,11 +2853,13 @@ f(<-ch)
</
pre
>
</
pre
>
<p>
<p>
If a receive expression is used in a
tuple assignment
of the form
If a receive expression is used in a
n assignment or initialization
of the form
</p>
</p>
<pre>
<pre>
x, ok =
<-ch
;
//
or:
x
,
ok
:=
<-ch
x, ok =
<-ch
x
,
ok
:=
<-ch
var
x
,
ok =
<-ch
</
pre
>
</
pre
>
<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