NOTE: can't initialize inline because https://github.com/golang/go/issues/1817
()
| 13 | |
| 14 | // NOTE: can't initialize inline because https://github.com/golang/go/issues/1817 |
| 15 | func init() { |
| 16 | fm := template.FuncMap{ |
| 17 | "transformAttribute": transformAttribute, |
| 18 | "transformHelperName": transformHelperName, |
| 19 | } |
| 20 | transformGoArrayT = template.Must(template.New("transformGoArray").Funcs(fm).Parse(codegenTemplates.Read(transformGoArrayTmplName))) |
| 21 | transformGoMapT = template.Must(template.New("transformGoMap").Funcs(fm).Parse(codegenTemplates.Read(transformGoMapTmplName))) |
| 22 | transformGoUnionT = template.Must(template.New("transformGoUnion").Funcs(fm).Parse(codegenTemplates.Read(transformGoUnionTmplName))) |
| 23 | } |
| 24 | |
| 25 | // GoTransform produces Go code that initializes the data structure defined |
| 26 | // by target from an instance of the data structure described by source. |