ReadDir now returns files from directories in all matching mount
points if no Go files are present in any of them. The behavior now
matches the documentation.
Fixesgolang/go#34571
Change-Id: I3a0c8d49a5906ec33ebe9e3efea9d2b9d267506c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/197801
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Change GetPageInfo method documentation to match the method name.
Prefer using "reports whether" in a function that returns a boolean.
This style is more idiomatic.
Updates golang/go#33655
Change-Id: I1a781e7b4f5b4b629fdf4f48e2e97183f63508f9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/196977
Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
- Removed the StandAlone and Asset root types as they were just there
for other vfses to satisfy the FileSystem interface and causing unnecessary
confusion. Returning just empty strings in those scenarios now to clarify
that it is a dummy placeholder.
- Removed the prefix "Fs" from RootType as it was unnecessary.
- Using the RootType type to pass down to the html templates
instead of converting to string. The templates are capable of converting
to the actual string representation when comparing the value.
Change-Id: Iadc039f1354ecd814eec0af1e52cdbaaeff0cc89
Reviewed-on: https://go-review.googlesource.com/106196
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This CL groups the package list into two groups - standard library(GOROOT),
and third-party code(GOPATH).
It also wraps the list with a collapsible div header used in the package
documentation page. This makes the entire page easy to view and manage, and also
makes it consistent with the rest of the pages.
To implement this, a new function was added to the filesystem interface
which returns the root type of the filesystem. In most cases, it is either GOROOT
or GOPATH. There are other kinds of filesystems which are not used in the home page,
so additional values have been added to satisfy the interface.
A side effect of this is that the html template code has become a bit spaghetti-like
with if conditions all over. This is because the same template is used to render
a package directory as well as the package home page. A better way is to use
two separate templates for the different tasks. This cleans out a lot of the
if conditions and make for a much cleaner code. This has been taken care in CL 101295.
Fixesgolang/go#3305Fixesgolang/go#15020
Change-Id: I876357dc76280a7df2ed08d7c6bc53d9a41e69ab
Reviewed-on: https://go-review.googlesource.com/95835
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
When building the corpus of local packages, a "too many open files"
error would cause some directories inside GOPATH to be skipped.
Further, the error would not be reported because it was masked by a
"file not found" error from the GOROOT VFS layer.
This change adds a rate limit around parsing files when buildling
the directory tree, error reporting when godoc is run with -v, and
fixes the masked error issue in the vfs package.
It's possible that the rate limiting could be put into the
godoc/vfs/gatefs package, but I tried making the gate account for
open files (not just individual open/close/read/write operations)
but then godoc just hard locks (it wasn't designed to only open 20
files at once).
Change-Id: I925d120b53d9a86430b6977cb90eb143785ecc48
Reviewed-on: https://go-review.googlesource.com/24060
Reviewed-by: Dave Day <djd@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
The existing implementation of NameSpace implicitly assumes that a
FileSystem with a directory at the top will be mounted at the root
mount point "/" of the NameSpace. If this is not the case, then
Stat("/") will fail even if ReadDir("/") succeedes. This is unexpected
behavior which breaks directory traversal routines (eg. http.FileServer).
This CL adds an unexported implementation of FileSystem called emptyVFS
that emulates an empty directory and adds a NewNameSpace() function that
binds emptyVFS to "/" so that unexpected behavior does not arise even if
the use does not mount anything explicitly at "/".
Latest patch set causes the FileInfo of the empty top level emulated
directory to return "/" for Name() and Zero Time for ModTime() and
removes the related struct state fields being used in the previous
implementation.
Fixesgolang/go#14190
Change-Id: Idce2fc3c9b81206847a33840d76b660059d53d18
Reviewed-on: https://go-review.googlesource.com/19445
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>