New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
embed: guarantee (*FS).Open
's returning value implements io.Seeker
#45745
Comments
Embedded directories do not implement Seek. (This bit me yesterday.) |
Ah, I see. So I want a guarantee that |
Yep. Or we could make directories seekers too, I guess. |
I think it would be fine to document that the result of |
This doesn't have to be a proposal, so taking it out of the proposal process. |
(*FS).Open
's returning value implements io.Seeker
(*FS).Open
's returning value implements io.Seeker
This sounds better to me, as
Hmm, always having |
While it might be true currently, wouldn’t adopting this make it impossible/much-more-difficult for the compiler to change how embedded files are stored? For instance to automatically compress them. I seem to recall being able to decide that kind of thing at a later time was part of the original proposal or discussion. |
I suppose I don't see a reason to support Since we already support |
Change https://golang.org/cl/313352 mentions this issue: |
From the current document, there is no guarantee whether
(*embed.FS).Open
's returning value implementsio.Seeker
or not.IIUC the returned value always implements
io.Seeker
in the current implementation, and actually it is fine to assume this (e.g., #44175 (comment)). Would it be possible to make the current behavior explicit in the document?The text was updated successfully, but these errors were encountered: