mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
Fixes golang/go#31621 Change-Id: I6d5cfde5d5bebc704c9178d40bb93801b255e01c Reviewed-on: https://go-review.googlesource.com/c/tools/+/173958 Reviewed-by: Ian Cottrell <iancottrell@google.com> Run-TryBot: Rebecca Stambler <rstambler@golang.org>
31 lines
794 B
Go
31 lines
794 B
Go
package foo
|
|
|
|
type StructFoo struct { //@item(StructFoo, "StructFoo", "struct{...}", "struct")
|
|
Value int //@item(Value, "Value", "int", "field")
|
|
}
|
|
|
|
// Pre-set this marker, as we don't have a "source" for it in this package.
|
|
/* Error() */ //@item(Error, "Error()", "string", "method")
|
|
|
|
func Foo() { //@item(Foo, "Foo()", "", "func")
|
|
var err error
|
|
err.Error() //@complete("E", Error)
|
|
}
|
|
|
|
func _() {
|
|
var sFoo StructFoo //@complete("t", StructFoo)
|
|
if x := sFoo; x.Value == 1 { //@complete("V", Value),typdef("sFoo", StructFoo)
|
|
return
|
|
}
|
|
}
|
|
|
|
func _() {
|
|
shadowed := 123
|
|
{
|
|
shadowed := "hi" //@item(shadowed, "shadowed", "string", "var")
|
|
sha //@complete("a", shadowed)
|
|
}
|
|
}
|
|
|
|
type IntFoo int //@item(IntFoo, "IntFoo", "int", "type"),complete("", Foo, IntFoo, StructFoo)
|