mirror of
https://github.com/golang/go
synced 2024-11-05 17:36:15 -07:00
5bc19071d3
- add tests for Open, ReadDir, and Stat funcs - add tests for Seek of Open() - simplify internal handling of absolute vs. "zip" paths - fix handling of "/" The fix special cases this scenario, leaving the codepath for all other file paths the same. Specifically, - Exported funcs call stat(), so stat("/") is handled by simply returning 0 to indicate all entries are (effectively) prefixed by "/" and zipFI{"", nil} because "/" has no name and nil indicates it is a directory. - ReadDir("/") is further handled by seeding the existing lookup logic with "" instead of what would have been "/". This is necessary because, per the zipfs spec, the zip file entries MUST NOT start with "/", so using "/" would incorrectly match nothing. This works because seeding lookup with "" (correctly) matches all files and then the following, existing logic (correctly) pares things down to just the files in the root directory; not in any subdirectories. Verified that godoc -zip still works. Fixes golang/go#12743 Change-Id: Icb5f01b8a29cefa4e2820135f318894042970301 Reviewed-on: https://go-review.googlesource.com/16925 Reviewed-by: Andrew Gerrand <adg@golang.org> |
||
---|---|---|
.. | ||
gatefs | ||
httpfs | ||
mapfs | ||
zipfs | ||
namespace.go | ||
os.go | ||
vfs.go |