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
I think the line:
l := int64(len(b))
should be
l := int64(cap(b))
i.e. the length of data copied should be based on the capacity of the array and not how much it has already been filled by other data.
The text was updated successfully, but these errors were encountered:
ReadAt reads len(b) bytes from the File starting at byte offset off. It returns the number of bytes read and the error, if any. ReadAt always returns a non-nil error when n < len(b). At end of file, that error is io.EOF.
i assume that go-billy needs to implement the same behaviour for consistency with standard library filesystem.
if b is an array (not a slice) then len(b) and cap(b) wil be equal, and if b is an empty array it is not possible for ReadAt to read anything without allocating, which is the responsibility of the caller
I think the line:
l := int64(len(b))
should be
l := int64(cap(b))
i.e. the length of data copied should be based on the capacity of the array and not how much it has already been filled by other data.
The text was updated successfully, but these errors were encountered: