type t1 struct { i int; s string }
var v1 reflect.Type = /* how to set to t1's reflect.Type? */
Run Code Online (Sandbox Code Playgroud)
是否有可能获得t1的reflect.Type而不必实例化它?
是否可以通过将其名称"t1"作为字符串来获取t1的reflect.Type?
例如,
type FooService interface {
Foo1(x int) int
Foo2(x string) string
}
Run Code Online (Sandbox Code Playgroud)
我试图做的是["Foo1", "Foo2"]
使用运行时反射获取列表。