mirror of
https://github.com/golang/go
synced 2024-11-19 06:34:42 -07:00
4ca280b5bd
specifically it uses them for the guru compatability tests This change radically increases the test coverage of the godef tests as it now works for all the jump to definition tests not just the specialized ones. Change-Id: I63547138566ac3de56344dcfddb758ed5f362a06 Reviewed-on: https://go-review.googlesource.com/c/tools/+/174937 Run-TryBot: Ian Cottrell <iancottrell@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
40 lines
652 B
Go
40 lines
652 B
Go
package a
|
|
|
|
import "fmt"
|
|
|
|
type Thing struct { //@Thing
|
|
Member string //@Member
|
|
}
|
|
|
|
var Other Thing //@Other
|
|
|
|
func Things(val []string) []Thing { //@Things
|
|
return nil
|
|
}
|
|
|
|
func (t Thing) Method(i int) string { //@Method
|
|
return t.Member
|
|
}
|
|
|
|
func useThings() {
|
|
t := Thing{} //@mark(aStructType, "ing")
|
|
fmt.Print(t.Member) //@mark(aMember, "ember")
|
|
fmt.Print(Other) //@mark(aVar, "ther")
|
|
Things() //@mark(aFunc, "ings")
|
|
t.Method() //@mark(aMethod, "eth")
|
|
}
|
|
|
|
/*@
|
|
godef(aStructType, Thing)
|
|
godef(aMember, Member)
|
|
godef(aVar, Other)
|
|
godef(aFunc, Things)
|
|
godef(aMethod, Method)
|
|
|
|
//param
|
|
//package name
|
|
//const
|
|
//anon field
|
|
|
|
*/
|