convertTest = wrapper.InnerStructType
-rob
You can't convert, but you can get at the embedded field by its name
(which, despite being anonynous, it does have):
http://golang.org/ref/spec#Struct_types
"An embedded type must be specified as a type name T or as a pointer
to a non-interface type name *T, and T itself may not be a pointer type.
The unqualified type name acts as the field name."
Chris
--
Chris "allusive" Dollin
[]*InnerStructType
--
matt kane's brain
http://hydrogenproject.com
Thanks guys confusion comes from the fact that Wrapper in java and other languages would be a super class of InnerStructType and hence it would be convertible. Using the direct accessor is an acceptable work around but does require quite a bit more work when for example you have an array of Wrapper's and you want to return an array of InnerStructType's a full range scan is needed to build a new array instead of just a cast. I don't suppose there's any avoiding that in go is there?
Thanks guys confusion comes from the fact that Wrapper in java and other languages would be a super class of InnerStructType and hence it would be convertible. Using the direct accessor is an acceptable work around but does require quite a bit more work when for example you have an array of Wrapper's and you want to return an array of InnerStructType's a full range scan is needed to build a new array instead of just a cast. I don't suppose there's any avoiding that in go is there?