diff --git a/doc/go_spec.html b/doc/go_spec.html index c29538e6a3..3134357bd4 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,5 +1,5 @@ - +

Receiving from a nil channel causes a @@ -4009,9 +4008,8 @@ iteration values for each entry will be produced at most once.

  • For channels, the iteration values produced are the successive values sent on -the channel until the channel is closed; it does not produce the zero value sent -before the channel is closed -(§close and closed). +the channel until the channel is closed +(§close).
  • @@ -4086,12 +4084,9 @@ cases all referring to communication operations. SelectStmt = "select" "{" { CommClause } "}" . CommClause = CommCase ":" { Statement ";" } . CommCase = "case" ( SendStmt | RecvStmt ) | "default" . -RecvStmt = [ Expression ( "=" | ":=" ) ] RecvExpr . +RecvStmt = [ Expression [ "," Expression ] ( "=" | ":=" ) ] RecvExpr . RecvExpr = Expression . -

    RecvExpr must be a receive operation. @@ -4122,27 +4117,24 @@ in the "select" statement. If multiple cases can proceed, a pseudo-random fair choice is made to decide which single communication will execute.

    - -The receive case may declare a new variable using a +The receive case may declare one or two new variables using a short variable declaration.

    -var c, c1, c2 chan int
    +var c, c1, c2, c3 chan int
     var i1, i2 int
     select {
     case i1 = <-c1:
     	print("received ", i1, " from c1\n")
     case c2 <- i2:
     	print("sent ", i2, " to c2\n")
    -
     default:
     	print("no communication\n")
     }
    @@ -4401,8 +4393,7 @@ BuiltinCall = identifier "(" [ BuiltinArgs [ "," ] ] ")" .
     BuiltinArgs = Type [ "," ExpressionList ] | ExpressionList .
     
    - -

    Close and closed

    +

    Close

    For a channel c, the built-in function close(c) @@ -4412,12 +4403,8 @@ After calling close, and after any previously sent values have been received, receive operations will return the zero value for the channel's type without blocking. - -After at least one such zero value has been -received, closed(c) returns true. +The multi-valued receive operation +returns a received value along with an indication of whether the channel is closed.