diff options
author | Ian Lance Taylor <iant@golang.org> | 2012-01-22 11:50:45 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2012-01-22 11:50:45 -0800 |
commit | 387e7c274249a307f62ed94c8dfdabfe42e3b01c (patch) | |
tree | 894467f913f2a2548828322ab8a3ebd047b3a663 /test/func4.go | |
parent | 41914c1df8f8689f2fba59cbdd1f8d00e73dbeed (diff) | |
download | go-387e7c274249a307f62ed94c8dfdabfe42e3b01c.tar.gz go-387e7c274249a307f62ed94c8dfdabfe42e3b01c.zip |
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
https://golang.org/cl/5561059
Diffstat (limited to 'test/func4.go')
-rw-r--r-- | test/func4.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/func4.go b/test/func4.go index 69ce56a197..2a1a932de9 100644 --- a/test/func4.go +++ b/test/func4.go @@ -11,4 +11,5 @@ var notmain func() func main() { var x = &main // ERROR "address of|invalid" main = notmain // ERROR "assign to|invalid" + _ = x } |