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

storage: Add CreateDir #28

Merged
merged 5 commits into from
Jun 15, 2021
Merged

storage: Add CreateDir #28

merged 5 commits into from
Jun 15, 2021

Conversation

JinnyYi
Copy link
Contributor

@JinnyYi JinnyYi commented Jun 11, 2021

storage.go Outdated Show resolved Hide resolved
@@ -359,7 +428,11 @@ func (s *Storage) stat(ctx context.Context, path string, opt pairStorageStat) (o
o = s.newObject(true)
o.ID = rp
o.Path = path
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to trim the Path trailing /

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’m confused about it. Is o.Path not the path passed in?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, in most time o.Path == path.

But for dir object, we add / after path test and send real API to test/. So after we got the information, we need to roll it back.

Maybe we could make it more clear by creating a new var: sp := path + "/".

In order to make this behavior works as expected, we can add check in go-integration-test, make sure returning path equals to input path.


Ooooops, the path hasn't been updated. Current logic is correct.

@@ -13,3 +13,19 @@ func TestStorage(t *testing.T) {
}
tests.TestStorager(t, setupTest(t))
}

// FIXME: For `CompleteMultipartUpload`, the numbers of the uploaded parts must be continuous and the part information entries in the request body must be sorted by number in ascending order
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's update tests intead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already updated.
ref: #30

@Xuanwo Xuanwo merged commit 34665e4 into master Jun 15, 2021
@Xuanwo Xuanwo deleted the create-dir branch June 15, 2021 02:04
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