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

mem: fix incorrect offset in Write #263

Merged
merged 3 commits into from
Sep 2, 2020
Merged

mem: fix incorrect offset in Write #263

merged 3 commits into from
Sep 2, 2020

Conversation

yerden
Copy link
Contributor

@yerden yerden commented Sep 2, 2020

Hello, everyone,

Recently I needed an in-memory implementation of io.WriteSeeker and tried to use File. Unfortunately, my code panicked using afero's File implementation whereas os.File implementation worked flawlessly.

It looks like Write incorrectly sets offset after appending data. I've written a test for correct behaviour and implemented a fix.

Also, I check whence value in Seek against io.Seek* literals so it reads easier for people with bad memory like me.

Signed-off-by: Yerden Zhumabekov <yerden.zhumabekov@gmail.com>
Signed-off-by: Yerden Zhumabekov <yerden.zhumabekov@gmail.com>
Signed-off-by: Yerden Zhumabekov <yerden.zhumabekov@gmail.com>
@CLAassistant
Copy link

CLAassistant commented Sep 2, 2020

CLA assistant check
All committers have signed the CLA.

@0xmichalis 0xmichalis merged commit 215b26b into spf13:master Sep 2, 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