Skip to content

Make MemMapFs.Stat("") fail like os.Stat - #652

Open
AshSgDe29071999 wants to merge 1 commit into
spf13:masterfrom
AshSgDe29071999:fix/memmap-stat-empty-path
Open

Make MemMapFs.Stat("") fail like os.Stat#652
AshSgDe29071999 wants to merge 1 commit into
spf13:masterfrom
AshSgDe29071999:fix/memmap-stat-empty-path

Conversation

@AshSgDe29071999

Copy link
Copy Markdown

Fixes #522

os.Stat(\"\") returns a not-exist path error. MemMapFs.Stat(\"\") succeeded and returned a directory FileInfo with an empty name, so tests that inject Afero in place of the OS filesystem diverged on empty paths.

Reject the empty path with os.ErrNotExist wrapped in os.PathError, matching os.Stat.

os.Stat(\"\") returns a not-exist path error. MemMapFs treated the empty
path as a directory, which broke tests that inject Afero in place of the
real filesystem.

See spf13#522
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MemMapFs.Stat does not handle empty string as expected

2 participants