[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 {
        //error
}

> 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.

-NR
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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