mirror of
https://github.com/golang/go.git
synced 2025-05-29 03:11:26 +00:00
We use the custom marker support to allow us to simplify the annotations, making it much easier to understand the tests. Change-Id: Id818a286e4e85f48cfe505f14ec82a80498e494c Reviewed-on: https://go-review.googlesource.com/c/149611 Run-TryBot: Ian Cottrell <iancottrell@google.com> Reviewed-by: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
24 lines
591 B
Go
24 lines
591 B
Go
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")
|