Golang: Can't get object by name error in example code
Closed this issue · 0 comments
Using the official google storage sdk version 1.43.0 I get the error code "object doesn't exists" when trying to fetch an object that is in fact there.
I preloaded data and have tried and have also tried to write the file first. It shows up if i iterate over all objects in the bucket, but if i try to create a NewReader it will yield "object doesn't exist".
To start the emulator i run:
docker run -d --name fake-gcs-server -p 4443:4443 -v ${PWD}/examples/data:/data fsouza/fake-gcs-server -scheme http
Then i run the example code
go run ./examples/go/main.go
It outputs :
buckets: [some_file.txt]
2024/08/12 12:28:03 storage: object doesn't exist
exit status 1
I am able to get the file with curl:
curl --insecure "http://localhost:4443/storage/v1/b/sample-bucket/o/some_file.txt?alt=media"
Perhaps something has changed in the client library?