]> Cypherpunks repositories - gostls13.git/commitdiff
test/closure2.go: correctly "use" tmp
authorRobert Griesemer <gri@golang.org>
Thu, 29 Jan 2015 22:18:52 +0000 (14:18 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 29 Jan 2015 22:22:14 +0000 (22:22 +0000)
cmd/go doesn't complain (this is an open issue), but go/types does

Change-Id: I2caec1f7aec991a9500d2c3504c29e4ab718c138
Reviewed-on: https://go-review.googlesource.com/3541
Reviewed-by: Alan Donovan <adonovan@google.com>
test/closure2.go

index 785e3ae2756f6f1a2c20245fa675cac9dee5031f..8947450561fbdb1a1a243371bcab7298a2cf2f9f 100644 (file)
@@ -54,6 +54,7 @@ func main() {
        }
        func() {
                tmp = w // force capture of w, but do not write to it yet
+               _ = tmp
                func() {
                        func() {
                                w++ // write in a nested closure