2012-02-16 23:48:57 -05:00
|
|
|
// errorcheck
|
2009-09-08 23:16:19 -07:00
|
|
|
|
|
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
2012-02-19 13:19:43 +11:00
|
|
|
// Test that incorrect uses of the blank identifer are caught.
|
|
|
|
|
// Does not compile.
|
|
|
|
|
|
2009-09-08 23:16:19 -07:00
|
|
|
package _ // ERROR "invalid package name _"
|
|
|
|
|
|
|
|
|
|
func main() {
|
2010-09-04 10:36:13 +10:00
|
|
|
_() // ERROR "cannot use _ as value"
|
|
|
|
|
x := _+1 // ERROR "cannot use _ as value"
|
2012-01-22 11:50:45 -08:00
|
|
|
_ = x
|
2009-09-08 23:16:19 -07:00
|
|
|
}
|