MCPcopy Create free account
hub / github.com/goadesign/goa / transformHelperName

Function transformHelperName

codegen/go_transform.go:702–717  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

700// transformHelperName returns the transformation function name to initialize a
701// target user type from an instance of a source user type.
702func 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}

Callers 4

transformObjectFunction · 0.70
transformUnionFunction · 0.70
collectHelpersFunction · 0.70
generateHelperFunction · 0.70

Calls 3

GoifyFunction · 0.85
PkgMethod · 0.80
NameMethod · 0.65

Tested by

no test coverage detected