This change reads $GOROOT/api/go1.*.txt when godoc starts and caches
information about which versions of Go introduce functions, types, and
methods. This information is displayed currently only in HTML output.
Functions, types, and methods introduced as part of Go 1 are not
annotated, as their presence at that version is implied.
This change does not address constants or variables, and completely
ignores the syscall package. The former are future work, the latter is
likely an exercise in futility. In all cases, this is because the story
around displaying the version information is not well developed.
Fixesgolang/go#5778
Change-Id: Ieb3cc0da7b18e195bc9c443f14fd8a82e8b2bbf8
Reviewed-on: https://go-review.googlesource.com/85396
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Devon O'Dell <dhobsd@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
- Setting the GOROOT build path to the value passed from the command line.
- Clarified the return values to named parameters for extra clarity.
- And while here, added some missed out error handling. Just logging the error
to preserve original behavior.
Fixesgolang/go#13296
Change-Id: I91427eee790928a3cfb51ae207747e9a17bd5496
Reviewed-on: https://go-review.googlesource.com/110275
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
This flag includes unexported identifiers in command-line mode.
It is equivalent to ?m=all in web mode.
Fixesgolang/go#8093
Change-Id: I1e5a69626929d3430638d900f3e975b272a98c90
Reviewed-on: https://go-review.googlesource.com/99435
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Currently, in http mode the server blocks until the corpus
has been initialized. This can cause considerable delay
if the user workspace is significantly large and the files
are not present in the buffer cache.
This CL spawns off the initialization in a separate goroutine
if httpMode is set and turns on a flag when it's done.
The http handler checks the flag and returns an error response
if it has not been set.
The check is only performed for the path prefixes handled by the
handlerServer struct. Other paths do not call the GetPageInfo() function
and hence can return immediately. This preserves maximum responsiveness
of the server.
Also adds an additional print statement in verbose mode
Note: This is a re-do of a previous CL golang.org/cl/88695 which was
incorrect committed without running tests. This CL fixes that test.
Fixesgolang/go#13278
Change-Id: I80c801f32af007312090d3783a2ea2c6f92cad66
Reviewed-on: https://go-review.googlesource.com/93215
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Currently, in http mode the server blocks until the corpus
has been initialized. This can cause considerable delay
if the user workspace is significantly large and the files
are not present in the buffer cache.
This CL spawns off the initialization in a separate goroutine
if httpMode is set and turns on a flag when it's done.
The http handler checks the flag and returns an error response
if it has not been set.
The check is only performed for the path prefixes handled by the
handlerServer struct. Other paths do not call the GetPageInfo() function
and hence can return immediately. This preserves maximum responsiveness
of the server.
Also adds an additional print statement in verbose mode
Fixesgolang/go#13278
Change-Id: I0505acc1c190423d09fb199b11ca86e0400e84d4
Reviewed-on: https://go-review.googlesource.com/88695
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Found with honnef.co/go/tools/cmd/unused.
Change-Id: I3db2aad14de33f0be69569cd355e453173098358
Reviewed-on: https://go-review.googlesource.com/37599
Reviewed-by: Alan Donovan <adonovan@google.com>
Explain how to make changes to the project's static files and get them compiled
in to the godoc binary.
Change-Id: I12e0c50bf31925b3f211b6d0dd3e5f8cff547f32
Reviewed-on: https://go-review.googlesource.com/34925
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
If built with the "autocert" build tag, use
golang.org/x/crypto/autocert and for automatic TLS certs.
This will be used for https://beta.golang.org/ running on GCE.
Change-Id: Id0e385796a25d663708ea9bb65c45cb1471dd526
Reviewed-on: https://go-review.googlesource.com/33751
Reviewed-by: Chris Broadfoot <cbro@golang.org>
On tip, search included redundant source results from /pkg/bootstrap
(with broken links as godoc doesn't support source files under /pkg).
This change excludes all directories under /pkg from indexing.
Fixesgolang/go#10024.
Change-Id: I0c69d22ff08d131f9c37c91a7711db6a4ec53fd4
Reviewed-on: https://go-review.googlesource.com/7267
Reviewed-by: Andrew Gerrand <adg@golang.org>
Rewrite performed with this command:
sed -i '' 's_code.google.com/p/go\._golang.org/x/_g' \
$(grep -lr 'code.google.com/p/go.' *)
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/170920043
To avoid breaking URLs, we redirect /src/pkg/* to /src/*.
The URL /pkg is now the "directory" /src, which triggers the
"Packages" index.
All other references to "src/pkg" are now gone,
except a number in the namespace documentation which are
probably still illustrative.
Tested: go test cmd/godoc godoc
Manual inspection of src and src/pkg pages.
with GOROOT and GOPATH packages
-analysis
/AUTHORS file URL still works
LGTM=bradfitz, adg
R=bradfitz, adg
CC=golang-codereviews
https://golang.org/cl/141770044
In command godoc, set IndexEnabled when the -write_index flag is set.
Previously you would need to (unintuitively) set the -http flag to
achieve this.
In package godoc, set up the FS tree before loading the index, and
then return before starting the index refresh loop. Previously the
index would be loaded and then immediately refreshed, negating the
benefits of the on-disk index.
TBR=bradfitz
R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/103370046
The text and images are "baked in" to the godoc executable's
rodata section (~300KB) and are accessible from the godoc
server itself at /lib/godoc/analysis/help.html.
In due course, the page will become visible at
http://golang.org/lib/godoc/analysis/help.html, which will be
the canonical location for this doc (in announcements, etc).
The page is temporarily visible here, for those on the Google corp network:
http://172.26.104.127:7777/lib/godoc/analysis/help.html
Also:
- add link to new doc from source view pages.
- document -analysis flag in cmd/godoc/doc.go
- fix indentation of -analysis flag's help string
LGTM=gri
R=gri, bgarcia, r
CC=golang-codereviews
https://golang.org/cl/87110045
See analysis.go for overview of new features.
See README for known bugs and issues.
Much UI polish, testing and optimization work remains, but
this is a starting point.
Flag: we add a new flag -analysis=type,pointer, default "",
for adventurous users only at this stage.
Type analysis takes ~10s for stdlib + go.tools;
Pointer analysis (currently) takes several minutes.
Dependencies: we now include jquery.treeview.js and its GIF
images among the resources. (bake.go now handles binary.)
LGTM=crawshaw, bgarcia
R=crawshaw, bgarcia
CC=bradfitz, golang-codereviews
https://golang.org/cl/60540044
Not for Go 1.2. Still needs a flag.
Linux at least (and likely other OSes) don't like you doing
a few hundred readdirs at once and spawing as many threads.
R=golang-dev, adg, jeremyjackins
CC=golang-dev
https://golang.org/cl/30620043
Add explicit options to Corpus to control search indexing of documentation, Go source code, and full-text.
R=bradfitz, r
CC=golang-dev
https://golang.org/cl/24190043
Also move some common code from main.go to handlers.go, and
exclude remotesearch.go from the appengine build (it is only
relevant to the command line interface).
R=bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/12001049
The exported Server becomes handlerServer, and part of Presentation
now. Presentation is also now an http.Handler with its own
internal mux (a detail, which might go away).
main.go becomes ever simpler.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/11505043
cmd/godoc/godoc.go is now merged into main.go, which is now
only 530 lines.
App Engine mode is still broken, but should be easy to fix up.
(just needs a global *godoc.Presentation created in init)
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/11498044
The plan for godoc:
- Copy godoc source from the core repo to go.tools (this CL).
- Break godoc into several packages inside go.tools, leaving a package
main that merely sets up a local file system, interprets the command
line, and otherwise delegates the heavy-lifting to the new packages.
- Remove godoc from the core repo.
- Update cmd/go to install this godoc binary in $GOROOT/bin.
- Update misc/dist to include godoc when building binary distributions.
R=bradfitz
CC=golang-dev
https://golang.org/cl/11408043