From: Rob Pike Date: Sat, 22 Aug 2009 07:04:04 +0000 (-0700) Subject: allow "comma ok" in initializers X-Git-Tag: weekly.2009-11-06~793 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d55370760f3d77a4d8717ffec17da5314034ad67;p=gostls13.git allow "comma ok" in initializers DELTA=11 (4 added, 0 deleted, 7 changed) OCL=33698 CL=33712 --- diff --git a/doc/go_spec.html b/doc/go_spec.html index 18357766d1..e362b7e76b 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -2160,12 +2160,13 @@ an otherwise legal index expression, a run-time exception occurs.

However, if an index expression on a map a of type map[K] V -is used in an assignment of one of the special forms +is used in an assignment or initialization of the form

 r, ok = a[x]
 r, ok := a[x]
+var r, ok = a[x]
 

@@ -2262,12 +2263,13 @@ is known only at run-time, the type of x.(T) is known to be T in a correct program.

-If a type assertion is used in an assignment of one of the special forms, +If a type assertion is used in an assignment or initialization of the form

 v, ok = x.(T)
 v, ok := x.(T)
+var v, ok = x.(T)
 

@@ -2851,11 +2853,13 @@ f(<-ch)

-If a receive expression is used in a tuple assignment of the form +If a receive expression is used in an assignment or initialization of the form

-x, ok = <-ch;  // or: x, ok := <-ch
+x, ok = <-ch
+x, ok := <-ch
+var x, ok = <-ch