Describe the bug
The Exists method should return false if the object doesn't exist instead of an error.
To Reproduce
package main
import (
"context"
"gocloud.dev/blob"
_ "gocloud.dev/blob/gcsblob"
)
func main() {
ctx := context.Background()
bucket, err := blob.OpenBucket(ctx, "gs://my-bucket")
if err != nil {
panic(err)
}
exists, err := bucket.Exists(ctx, "valid.tar.gz")
if err != nil {
panic(err)
}
if !exists {
panic("the file should have existed")
}
exists, err = bucket.Exists(ctx, "invalid.tar.gz")
if err != nil {
panic(err)
}
if exists {
panic("the file should not have existed")
}
}
This sample code is from @appaquet
Refer to googleapis/google-cloud-go#11845
Additional context
We recently changed the error wrapping in the GCS SDK. I believe the fix should be a simple change; I will open a PR.
Describe the bug
The Exists method should return false if the object doesn't exist instead of an error.
To Reproduce
This sample code is from @appaquet
Refer to googleapis/google-cloud-go#11845
Additional context
We recently changed the error wrapping in the GCS SDK. I believe the fix should be a simple change; I will open a PR.