()
| 180 | } |
| 181 | |
| 182 | func (stct *Struct) PublicMethods() (methods []*Function) { |
| 183 | for _, file := range stct.Package().Files() { |
| 184 | for _, fn := range file.Functions() { |
| 185 | recv := fn.Receiver() |
| 186 | if recv == nil { |
| 187 | continue |
| 188 | } |
| 189 | if fn.Private() || TypeName(recv.Type()) != stct.Name() { |
| 190 | continue |
| 191 | } |
| 192 | methods = append(methods, fn) |
| 193 | } |
| 194 | } |
| 195 | return methods |
| 196 | } |
| 197 | |
| 198 | // Field is a regular struct field |
| 199 | type Field struct { |