feat: add BridgeIOFS adapter and update README#575
Open
spf13 wants to merge 2 commits into
Open
Conversation
spf13
commented
Mar 12, 2026
Owner
- Add NewBridgeIOFS to import any io/fs.FS as a read-only afero.Fs
- Add iofsbridge_test.go with full test coverage
- Update README: bidirectional io/fs bridge section, BridgeIOFS in backend reference table, new embedded assets + CopyOnWrite use case, fix incorrect afero.FromIOFS reference to afero.NewBridgeIOFS
- Add NewBridgeIOFS to import any io/fs.FS as a read-only afero.Fs - Add iofsbridge_test.go with full test coverage - Update README: bidirectional io/fs bridge section, BridgeIOFS in backend reference table, new embedded assets + CopyOnWrite use case, fix incorrect afero.FromIOFS reference to afero.NewBridgeIOFS
- Use errors.Is(err, os.ErrPermission) instead of os.IsPermission(): the latter only unwraps *PathError/*LinkError/*SyscallError, not fmt.Errorf- wrapped errors, so the existing check always returned false. - Skip TestBridgeIOFS_FSTestCompliance on Windows: afero.IOFS.Glob uses filepath.Match which on Windows treats backslash as a path separator and rejects the backslash-escaped character-class patterns (e.g. [\t]) that fstest.TestFS generates. This is a pre-existing IOFS adapter limitation, consistent with how the existing TestIOFS is skipped. - Fix TestBridgeIOFS_InterfacesNotSupported: fstest.MapFS files embed a bytes.Reader which implements io.Seeker and io.ReaderAt, so the test assumption that they don't was wrong. Add BridgeBasicFile/BridgeNonSeekableFS mocks that explicitly omit those interfaces. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.