beyondstorage / go-storage

A vendor-neutral storage library for Golang: Write once, run on every storage service.

Home Page:https://beyondstorage.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

services/s3: While ListMode is ListModeDir, we need to add suffix under path

Xuanwo opened this issue · comments

In byctl, we implemented ls command through List with ListModeDir. After adding suffix under path for List with ListModeDir, we can't get the objects without the / prefix in the object name.

// If ListMode is dir, we need to add suffix for it.
if !strings.HasSuffix(path, "/") {
input.prefix += "/"
}

I think it's a bug that introduced in this commit. Instead, we need to update path before s.getAbsPath(path).

ping @Joey2132, can you also fix this problem for s3?

commented

ping @Joey2132, can you also fix this problem for s3?

Got it. I will do it soon.