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
When encoding/decoding structs, it is often useful to insert padding between fields,
especially when working with foreign data formats. Using anonymous field names
(underscore) is the most natural way to do this. binary.Write handles this just fine,
but binary.Read panics because the field '_' is unexported. If possible, this should be
handled as a special case.
What steps will reproduce the problem?
http://play.golang.org/p/uDI-I9saFy
What is the expected output?
01 00 00 00 00 00 00 00 02 00 00 00
{1 [0 0 0 0] 2}
What do you see instead?
01 00 00 00 00 00 00 00 02 00 00 00
panic: reflect.Value.SetUint using value obtained using unexported field
...
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g
Which operating system are you using?
Windows 7
Which version are you using? (run 'go version')
1.0.3
The text was updated successfully, but these errors were encountered:
This request seems not unreasonable. Since _ fields cannot be accessed anyway within the
language, it would be fine to skip the respective data when decoding into a struct with
_ fields.
The text was updated successfully, but these errors were encountered: