Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion oss/gcsblob/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (g *GoogleCloudStorage) List(prefix string) ([]oss.OSSPath, error) {
key = strings.TrimPrefix(key, "/")

res = append(res, oss.OSSPath{
Path: attrs.Name,
Path: key,
IsDir: false,
})

Expand Down
3 changes: 3 additions & 0 deletions tests/oss/oss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ func TestAll(t *testing.T) {
ossPaths, err = storage.List(prefix)
assert.Equal(t, 1, len(ossPaths), info)
assert.Nil(t, err, info)
// Verify that List returns relative paths (without prefix)
expectedRelativePath := key[len(prefix)+1:] // +1 for the "/" separator
assert.Equal(t, expectedRelativePath, ossPaths[0].Path, info+" - List should return relative path")

err = storage.Delete(key)
assert.Nil(t, err, info)
Expand Down