Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

feat: Add support for Write Empty File Behavior #31

Merged
merged 4 commits into from
Sep 26, 2021

Conversation

abyss-w
Copy link
Contributor

@abyss-w abyss-w commented Sep 26, 2021

No description provided.

storage.go Outdated

if err != nil {
return int64(read), err
if size != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about check size == 0 instead of size != 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be verified this way.

storage.go Outdated
if size == 0 {
return size, nil
}
o.mode = ModeRead
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A size == 0 object still needs ModeRead.

@Xuanwo Xuanwo merged commit 5eea156 into beyondstorage:master Sep 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants