ExtractUserExamples return the examples defined in the design directly on the attribute or on its type.
()
| 649 | // ExtractUserExamples return the examples defined in the design directly on the |
| 650 | // attribute or on its type. |
| 651 | func (a *AttributeExpr) ExtractUserExamples() []*ExampleExpr { |
| 652 | if len(a.UserExamples) > 0 { |
| 653 | return a.UserExamples |
| 654 | } |
| 655 | ut, ok := a.Type.(UserType) |
| 656 | if !ok { |
| 657 | return nil |
| 658 | } |
| 659 | return ut.Attribute().ExtractUserExamples() |
| 660 | } |
| 661 | |
| 662 | // Debug dumps the attribute to STDOUT in a goa developer friendly way. |
| 663 | func (a *AttributeExpr) Debug(prefix string) { a.debug(prefix, make(map[*AttributeExpr]int), 0) } |
no test coverage detected