summaryrefslogtreecommitdiff
path: root/test/blank1.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2012-01-22 11:50:45 -0800
committerIan Lance Taylor <iant@golang.org>2012-01-22 11:50:45 -0800
commita3e31b3541b0a95b0eb32687049a7647d1e3ebda (patch)
tree93a721a69516658ae8ee34641675f7ff49b8625b /test/blank1.go
parente5c443d5ce71d67226ab640a37fc7c1e23737a91 (diff)
downloadgo-a3e31b3541b0a95b0eb32687049a7647d1e3ebda.tar.gz
test: explicitly use variables to avoid gccgo "not used" error
I haven't looked at the source, but the gc compiler appears to omit "not used" errors when there is an error in the initializer. This is harder to do in gccgo, and frankly I think the "not used" error is still useful even if the initializer has a problem. This CL tweaks some tests to avoid the error, which is not the point of these tests in any case. R=golang-dev, r CC=golang-dev http://codereview.appspot.com/5561059
Diffstat (limited to 'test/blank1.go')
-rw-r--r--test/blank1.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/blank1.go b/test/blank1.go
index 5bc1efce5..bcc78466d 100644
--- a/test/blank1.go
+++ b/test/blank1.go
@@ -9,4 +9,5 @@ package _ // ERROR "invalid package name _"
func main() {
_() // ERROR "cannot use _ as value"
x := _+1 // ERROR "cannot use _ as value"
+ _ = x
}