diff --git a/storage/gs.go b/storage/gs.go index 38732f407..03fd07a79 100644 --- a/storage/gs.go +++ b/storage/gs.go @@ -76,7 +76,10 @@ func (gs *GSBackend) Get(ctx context.Context, rawurl string, hostPath string, cl } else if class == tes.FileType_DIRECTORY { // TODO not handling pagination - objects, _ := gs.svc.Objects.List(url.bucket).Prefix(url.path).Do() + objects, err := gs.svc.Objects.List(url.bucket).Prefix(url.path).Do() + if err != nil { + return err + } for _, obj := range objects.Items { call := gs.svc.Objects.Get(url.bucket, obj.Name) key := strings.TrimPrefix(obj.Name, url.path) diff --git a/tests/storage/gs_test.go b/tests/storage/gs_test.go index dbba98066..dd457e26d 100644 --- a/tests/storage/gs_test.go +++ b/tests/storage/gs_test.go @@ -176,7 +176,10 @@ func (g *gsTest) createBucket(projectID, bucket string) error { } func (g *gsTest) deleteBucket(bucket string) error { - // emptyBucket(g.bucket) - // g.client.Buckets.Delete(g.bucket) + objects, _ := g.client.Objects.List(bucket).Do() + for _, obj := range objects.Items { + g.client.Objects.Delete(bucket, obj.Name).Do() + } + g.client.Buckets.Delete(bucket).Do() return nil }