mirror of
https://github.com/golang/go
synced 2024-11-26 20:41:24 -07:00
spec: complete list of special comma-ok forms
The enumerations didn't include the syntactic form where the lhs is full variable declaration with type specification, as in: var x, ok T = ... Fixes #15782. Change-Id: I0f7bafc37dc9dcf62cdb0894a0d157074ccd4b3e Reviewed-on: https://go-review.googlesource.com/27670 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
78bc418f1d
commit
507051d694
@ -1,6 +1,6 @@
|
|||||||
<!--{
|
<!--{
|
||||||
"Title": "The Go Programming Language Specification",
|
"Title": "The Go Programming Language Specification",
|
||||||
"Subtitle": "Version of May 31, 2016",
|
"Subtitle": "Version of August 24, 2016",
|
||||||
"Path": "/ref/spec"
|
"Path": "/ref/spec"
|
||||||
}-->
|
}-->
|
||||||
|
|
||||||
@ -2933,6 +2933,7 @@ used in an <a href="#Assignments">assignment</a> or initialization of the specia
|
|||||||
v, ok = a[x]
|
v, ok = a[x]
|
||||||
v, ok := a[x]
|
v, ok := a[x]
|
||||||
var v, ok = a[x]
|
var v, ok = a[x]
|
||||||
|
var v, ok T = a[x]
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@ -3130,6 +3131,7 @@ A type assertion used in an <a href="#Assignments">assignment</a> or initializat
|
|||||||
v, ok = x.(T)
|
v, ok = x.(T)
|
||||||
v, ok := x.(T)
|
v, ok := x.(T)
|
||||||
var v, ok = x.(T)
|
var v, ok = x.(T)
|
||||||
|
var v, ok T1 = x.(T)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@ -3737,6 +3739,7 @@ A receive expression used in an <a href="#Assignments">assignment</a> or initial
|
|||||||
x, ok = <-ch
|
x, ok = <-ch
|
||||||
x, ok := <-ch
|
x, ok := <-ch
|
||||||
var x, ok = <-ch
|
var x, ok = <-ch
|
||||||
|
var x, ok T = <-ch
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
Loading…
Reference in New Issue
Block a user