31 lines
589 B
Go
31 lines
589 B
Go
package describe // @describe pkgdecl "describe"
|
|
|
|
// @implements implements "^"
|
|
|
|
// Tests of 'describe' and 'implements' queries, -format=json.
|
|
// See go.tools/oracle/oracle_test.go for explanation.
|
|
// See describe-json.golden for expected query results.
|
|
|
|
func main() { //
|
|
var s struct{ x [3]int }
|
|
p := &s.x[0] // @describe desc-val-p "p"
|
|
|
|
var i I = C(0)
|
|
if i == nil {
|
|
i = new(D)
|
|
}
|
|
_ = i // @describe desc-val-i "i"
|
|
|
|
go main() // @describe desc-stmt "go"
|
|
}
|
|
|
|
type I interface {
|
|
f()
|
|
}
|
|
|
|
type C int // @describe desc-type-C "C"
|
|
type D struct{}
|
|
|
|
func (c C) f() {}
|
|
func (d *D) f() {}
|