How to get all defined types?

前端 未结 4 1248
我在风中等你
我在风中等你 2020-12-21 03:10
package demo

type People struct {
    Name string
    Age  uint
}

type UserInfo struct {
    Address  string
    Hobby           


        
4条回答
  •  [愿得一人]
    2020-12-21 04:11

    Drat, I was hoping that Jsor's answer was wrong, but I can't find any way to do it.

    All is not lost though: If you have the source to 'demo', you could use the parser package to fish out the information you need. A bit of a hack though.

提交回复
热议问题