Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ReadAt/Seek test #182

Merged
merged 2 commits into from
Mar 27, 2020
Merged

add ReadAt/Seek test #182

merged 2 commits into from
Mar 27, 2020

Conversation

btc
Copy link
Contributor

@btc btc commented Nov 20, 2018

This PR demonstrates a deviation from the io.ReaderAt API contract in the mem.File implementation.

If ReadAt is reading from an input source with a seek offset, ReadAt should not affect nor be affected by the underlying seek offset.

func (f *File) ReadAt(b []byte, off int64) (n int, err error) {

The PR modifies the mem.File impl to respect the contract by storing the original offset before the Read and restoring the offset after the Read.

@CLAassistant
Copy link

CLAassistant commented Nov 20, 2018

CLA assistant check
All committers have signed the CLA.

@0xmichalis 0xmichalis merged commit cc3719f into spf13:master Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants