gocloud - writing data to a bucket: 403
2022-12-23
Problem
We are writing some integration test using Go CDK. After writing some data to a bucket:
writer, err := buckOut.NewWriter(ctx, fileDst, nil)
if err != nil {
logger.Errorf("failed to write to fileDst: %v", err)
return err
}
defer writer.Close()
we got an error when reading:
(code=NotFound): storage: object doesn't exist
By reading the documentation, I pay attention to this:
Closing the writer commits the write to the provider, flushing any buffers, and releases any resources used while writing, so you must always check the error of Close.
Quan Tong