Closed myaaaaaaaaa closed 3 months ago
Agreed that that would have been a better design, but I don't really want to make a breaking change at this point.
However, I think it should be easy to make it so that SetIOFSCallback
isn't required, which I think is actually even better. If it's never called, we can just use context.Background()
and a default ReaderOptions
.
Is your feature request related to a problem? Please describe.
blob.Bucket
implementsio/fs.FS
, but currently contains a minor papercut whereSetIOFSCallback()
must be called before it can be used as such.Describe the solution you'd like
One way to prevent this would be to remove
Open()
fromblob.Bucket
so that it no longer implementsio/fs.FS
, and replaceSetIOFSCallback()
with a function that returns aio/fs.SubFS
:This would make it impossible to use a
blob.Bucket
as anio/fs.FS
without configuring a context first.Usage would look something like the following:
This would be a breaking change.