golang/xenlight: implement constructor generation
authorNick Rosbrook <rosbrookn@gmail.com>
Mon, 2 Mar 2020 20:10:24 +0000 (15:10 -0500)
committerGeorge Dunlap <george.dunlap@citrix.com>
Mon, 9 Mar 2020 14:34:36 +0000 (14:34 +0000)
commit86184145006d5cc02f8c57e1e516c76205f4d8cc
tree2762fd27c1ded9309d5268c01aef1be43d3acb7e
parent5657d6765717ee309d758fe573f832c28b67cbc7
golang/xenlight: implement constructor generation

Generate constructors for generated Go types. Call libxl_<type>_init so
the Go type can be properly initialized.

If a type has a keyed union field, add a parameter to the function
signature to set the key variable, and call the init function for the
keyed union.

Signed-off-by: Nick Rosbrook <rosbrookn@ainfosec.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
tools/golang/xenlight/gengotypes.py
tools/golang/xenlight/helpers.gen.go
tools/golang/xenlight/types.gen.go