Re: [go-nuts] C union type to go native types

2017-04-18 Thread andrey mirtchovski
I usually create a separate struct for each part of the union and provide interface methods for un/marshalling. It is more work, but I find it to be much cleaner in the end: once those are created the union doesn't "leak" into the go code. On Tue, Apr 18, 2017 at 8:41 AM, Vasiliy Tolstov

[go-nuts] C union type to go native types

2017-04-18 Thread Vasiliy Tolstov
I have Some C struct like https://libvirt.org/html/libvirt-libvirt-common.html#virTypedParameter that needs to be binary Unmarshal to go native interface (xdr2), does it possible to represent via one go struct all needed things, or i need to create for each type struct and provide needed