[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC] Generating Go bindings for libxl

> Unfortunately this would mean the type assertion would be pretty long as
> well:
>   hvm := di.TypeUnion.(xenlight.DomainBuildInfoTypeUnionHvm)
>   hvm.[element]

Made worse by the fact that you really should check the type assertion first:

hvm, ok := di.TypeUnion.(xenlight.DomainBuildInfoTypeUnionHvm)
if !ok {

> But unfortunately I don't think there's a way around that; that's just a
> limitation of Go.

Right. If we wanted to make it easier on the users of the package, we *could*
add getters that hides the type assertion. But, that's still an extra step 
versus C.

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.