mirror of
https://github.com/golang/go
synced 2024-11-18 23:44:43 -07:00
806e1cfd89
Use the packagestest framework to test completion. Add support for a slice of token.Position to packagestest to support this. Change-Id: Ie5ddece4446a3c74419727461a77faa3788cb040 Reviewed-on: https://go-review.googlesource.com/c/148197 Reviewed-by: Ian Cottrell <iancottrell@google.com> Run-TryBot: Rebecca Stambler <rstambler@golang.org>
22 lines
354 B
Go
22 lines
354 B
Go
// +build go1.11
|
|
|
|
package bad
|
|
|
|
func stuff() {
|
|
x := "heeeeyyyy"
|
|
random2(x) //@diag("x", "cannot use x (variable of type string) as int value in argument to random2")
|
|
random2(1)
|
|
y := 3 //@diag("y", "y declared but not used")
|
|
}
|
|
|
|
type bob struct {
|
|
x int
|
|
}
|
|
|
|
func _() {
|
|
var q int
|
|
_ = &bob{
|
|
f: q, //@diag("f", "unknown field f in struct literal")
|
|
}
|
|
}
|