]> Cypherpunks repositories - gostls13.git/commitdiff
spec: complete list of special comma-ok forms
authorRobert Griesemer <gri@golang.org>
Wed, 24 Aug 2016 18:33:55 +0000 (11:33 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 24 Aug 2016 21:24:28 +0000 (21:24 +0000)
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>
doc/go_spec.html

index 731186e66b23f6c79c2d19edd56d13b7a5e3bd41..75dc2e4634e68aaef40f767d3d19ab811e3f9868 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of May 31, 2016",
+       "Subtitle": "Version of August 24, 2016",
        "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]
 var v, ok = a[x]
+var v, ok T = a[x]
 </pre>
 
 <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)
 var v, ok = x.(T)
+var v, ok T1 = x.(T)
 </pre>
 
 <p>
@@ -3737,6 +3739,7 @@ A receive expression used in an <a href="#Assignments">assignment</a> or initial
 x, ok = &lt;-ch
 x, ok := &lt;-ch
 var x, ok = &lt;-ch
+var x, ok T = &lt;-ch
 </pre>
 
 <p>