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
x/tools/godoc/vfs: missing root directory listing when mounting vfs.NameSpace via httpfs and serving by http.FileServer #14190
Comments
godoc never relies on that functionality so it's possible it's just a bug we never noticed. |
I have figured out the reason this bug is happening. The issue is that behavior of The issue is that The use case above mounts several folders under root but nothing at root breaking this implicit assumption. Unless we explicitly bind a Most algorithms that traverse a directory structure either I was able to get the right behavior by If i mount an empty directory at root like below.
I think the least disruptive resolution to this issue will be to add a Happy to work on a CL if the approach sounds ok. |
I have a working implementation of a fix for this issue at https://github.com/srinathh/emptyvfs for review/discussion of the proposed solution approach. If the approach looks ok, I can move the implementation into |
Feel free to send a code review. In addition to being easier to review in Gerrit, it will also guarantee that you've signed a CLA (since our Gerrit doesn't allow uploads before a CLA is signed). Reviewers shouldn't be reviewing code elsewhere (e.g. your personal github repo) without knowing a CLA is on file anyway. |
Thanks! Submitted CL https://go-review.googlesource.com/19445 |
CL https://golang.org/cl/19445 mentions this issue. |
Hi Brad, did you get a chance to review the CL? |
I'm trying to mount a few folders into a virtual file system via
vfs.NameSpace
and serving them usinghttp.FileServer
through ahttpfs.New()
. I am unable to see a listing of the root folder ofNameSpace
and get a404 page not found
.Interestingly, when i do
NameSpace.ReadDir("/")
on the NameSpace and loop through the results, i see the expected folders. There are also no problems getting a directory listing via eitherhttp.Dir()
orhttpfs.New(vfs.OS("FolderName"))
.Also when I directly browse the mounted folders (as explained below), I see the folders mounted properly. Only the root directory is not listing.
The text was updated successfully, but these errors were encountered: