From 6721aa88c76f7bab6e175335369693c45774c0c3 Mon Sep 17 00:00:00 2001 From: kawaihiroo Date: Tue, 24 Feb 2026 22:32:52 +0900 Subject: [PATCH] fix: add trailing slash to GCS List prefix to prevent collisions --- oss/gcsblob/gcs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/oss/gcsblob/gcs.go b/oss/gcsblob/gcs.go index 0d8a531..6cbf082 100644 --- a/oss/gcsblob/gcs.go +++ b/oss/gcsblob/gcs.go @@ -104,6 +104,9 @@ func (g *GoogleCloudStorage) State(key string) (oss.OSSState, error) { } func (g *GoogleCloudStorage) List(prefix string) ([]oss.OSSPath, error) { + if !strings.HasSuffix(prefix, "/") { + prefix = prefix + "/" + } ctx := context.Background() it := g.client.Bucket(g.bucket).Objects(ctx, &storage.Query{ Prefix: prefix,