There are functions in types, IsPointer() and IsArray(), that return whether or not the provided type is a pointer or array, respectively. However, there is no way to know what the pointer is pointing to or what the array is storing, which makes working with them incredibly difficult. item.Type().(types.PointerType).ElemType and item.Type().(types.ArrayType).ElemType should work, but they don't, because the Go compiler won't allow the type assertion:
impossible type assertion: item.Type().(types.PointerType)
types.PointerType does not implement types.Type (method Equal has pointer receiver)
Please fix this; it is incredibly difficult to create pointers and arrays currently.
There are functions in
types
,IsPointer()
andIsArray()
, that return whether or not the provided type is a pointer or array, respectively. However, there is no way to know what the pointer is pointing to or what the array is storing, which makes working with them incredibly difficult.item.Type().(types.PointerType).ElemType
anditem.Type().(types.ArrayType).ElemType
should work, but they don't, because the Go compiler won't allow the type assertion:Please fix this; it is incredibly difficult to create pointers and arrays currently.