data := make([]int32, size)
err := binary.Read(file, binary.LittleEndian, data)
but this fails with io.ErrUnexpectedEOF when file is smaller than
size. If this is intended, I'd suggest to rename the function to
ReadFull and fill data as much as we can before returning the error,
as io.ReadFull does. If there is no need to fail here, it would be
even simpler to forget about io.ReadFull and just use the Read method
directly.
Whatever is the best solution I have no problem to send the CL (and,
while I'm into it, send another one to fix issue 1305). Anyway, I
think the documentation should be clearer about what happens when
binary.Read finds EOF. I needed to look at binary.go to understand
what was going on.
--
- yiyus || JGL . 4l77.com