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
type Section4 struct {
LocalUse []byte
}
func readSection4(f *os.File, len uint32) (section Section4, err error) {
section.LocalUse = make([]byte, len)
// this will work OK
err = binary.Read(f, binary.BigEndian, §ion.LocalUse)
// this will end with ERROR: binary.Read: invalid type []uint8
err = binary.Read(f, binary.BigEndian, §ion)
}
The text was updated successfully, but these errors were encountered:
This is behaving as documented. "Data must be a pointer to a fixed-size value or a slice of fixed-size values." Passing §ion.LocalUse is a pointer to a slice of fixed-size values. Passing §ion is not a pointer to a fixed-size value, because the struct contains a slice.
Hi
i have this code (simplified):
The text was updated successfully, but these errors were encountered: