fieldCode generates code to initialize the data structures fields from the given args. It is used only in templates.
(init *PayloadInitData)
| 593 | // fieldCode generates code to initialize the data structures fields |
| 594 | // from the given args. It is used only in templates. |
| 595 | func fieldCode(init *PayloadInitData) string { |
| 596 | varn := "res" |
| 597 | if init.ReturnTypeAttribute == "" { |
| 598 | varn = "v" |
| 599 | } |
| 600 | // We can ignore the transform helpers as there won't be any generated |
| 601 | // because the args cannot be user types. |
| 602 | c, _, err := codegen.InitStructFields(init.Args, varn, "", init.ReturnTypePkg) |
| 603 | if err != nil { |
| 604 | panic(err) // bug |
| 605 | } |
| 606 | return c |
| 607 | } |
nothing calls this directly
no test coverage detected