1
0
mirror of https://github.com/golang/go synced 2024-10-01 09:38:36 -06:00
go/internal/lsp/testdata/foo/foo.go

24 lines
591 B
Go
Raw Normal View History

package foo
type StructFoo struct { //@item(StructFoo, "StructFoo", "struct{...}", "struct")
Value int //@item(Value, "Value", "int", "field")
}
// TODO(rstambler): Create pre-set builtins?
/* 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)
return
}
}
//@complete("", Foo, IntFoo, StructFoo)
type IntFoo int //@item(IntFoo, "IntFoo", "int", "type")