You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The short answer is that I can support it, but it will involve duplicating code. Which is clearly a better option that not supporting.
The long answer:
Not all arrays are addressable.
An array which is a field in a non-addressable value is not addressable.
Consequently, in your example above, encoder.Encode(&b) will work, but encoder.Encode(b) will not.
The error happened because I wanted to eliminate code duplication, so when it was time to encode an array, I converted it to a slice and sent it to the kSlice method.
Clearly this is not robust, so I'd do the duplication and try to reduce code size in both.
Fix coming soon.
I don't have tests for non-addressable arrays (unfortunately). I'd add one.
It appears that arrays are not able to be serialized.
This snippet produces:
2013/11/14 09:01:41 Failed to encode:reflect.Value.Slice: slice of unaddressable array
Are arrays not able to be serialized?
The text was updated successfully, but these errors were encountered: