transformHelperName returns the transformation function name to initialize a target user type from an instance of a source user type.
(source, target *expr.AttributeExpr, ta *TransformAttrs)
| 700 | // transformHelperName returns the transformation function name to initialize a |
| 701 | // target user type from an instance of a source user type. |
| 702 | func transformHelperName(source, target *expr.AttributeExpr, ta *TransformAttrs) string { |
| 703 | var ( |
| 704 | sname string |
| 705 | tname string |
| 706 | prefix string |
| 707 | ) |
| 708 | { |
| 709 | sname = Goify(ta.SourceCtx.Scope.Name(source, ta.SourceCtx.Pkg(source), ta.SourceCtx.Pointer, ta.SourceCtx.UseDefault), true) |
| 710 | tname = Goify(ta.TargetCtx.Scope.Name(target, ta.TargetCtx.Pkg(target), ta.TargetCtx.Pointer, ta.TargetCtx.UseDefault), true) |
| 711 | prefix = ta.Prefix |
| 712 | if prefix == "" { |
| 713 | prefix = "transform" |
| 714 | } |
| 715 | } |
| 716 | return Goify(prefix+sname+"To"+tname, false) |
| 717 | } |
no test coverage detected