summaryrefslogtreecommitdiff
path: root/test/fixedbugs/bug069.go
diff options
context:
space:
mode:
authorRobert Hencke <robert.hencke@gmail.com>2011-03-22 10:32:43 -0700
committerRobert Hencke <robert.hencke@gmail.com>2011-03-22 10:32:43 -0700
commit99a0504d8cdfb34dcbc2dfe2a3898e45f48b40b8 (patch)
tree1d8fa2c3336b2634281b226a11bf982f4a8b06c7 /test/fixedbugs/bug069.go
parent2b2f23069cf0ba0d937a679525297c58c440f9e9 (diff)
downloadgo-99a0504d8cdfb34dcbc2dfe2a3898e45f48b40b8.tar.gz
test: enable tests using v, ok := <-ch syntax
R=rsc, r CC=golang-dev http://codereview.appspot.com/4290059 Committer: Rob Pike <r@golang.org>
Diffstat (limited to 'test/fixedbugs/bug069.go')
-rw-r--r--test/fixedbugs/bug069.go21
1 files changed, 10 insertions, 11 deletions
diff --git a/test/fixedbugs/bug069.go b/test/fixedbugs/bug069.go
index bf7316313..9038387ac 100644
--- a/test/fixedbugs/bug069.go
+++ b/test/fixedbugs/bug069.go
@@ -7,15 +7,14 @@
package main
func main() {
- //TODO(rsc): uncomment when this syntax is valid for receive+check closed
- // c := make(chan int);
- // ok := false;
- // var i int;
- //
- // i, ok = <-c; // works
- // _, _ = i, ok;
- //
- // ca := new([2]chan int);
- // i, ok = <-(ca[0]); // fails: c.go:11: bad shape across assignment - cr=1 cl=2
- // _, _ = i, ok;
+ c := make(chan int);
+ ok := false;
+ var i int;
+
+ i, ok = <-c; // works
+ _, _ = i, ok;
+
+ ca := new([2]chan int);
+ i, ok = <-(ca[0]); // fails: c.go:11: bad shape across assignment - cr=1 cl=2
+ _, _ = i, ok;
}