1
0
mirror of https://github.com/golang/go synced 2024-10-01 12:28:37 -06:00
Commit Graph

165 Commits

Author SHA1 Message Date
Dmitri Shuralyov
f595fb5c96 cmd/godoc, godoc: implement build.Context.IsDir, update expected error string
Prior to this change, handlerServer.GetPageInfo created a build.Context
starting with build.Default, and provided custom implementations for
its IsAbsPath, ReadDir, and OpenFile funcs. Those funcs would operate
on h.c.fs virtual filesystem.

https://godoc.org/go/build#Context.IsDir is documented as:

	// IsDir reports whether the path names a directory.
	// If IsDir is nil, Import calls os.Stat and uses the result's IsDir method.
	IsDir func(path string) bool

IsDir was left as nil, and so the default implementation was used.
The default implementation uses os.Stat and isn't aware of the h.c.fs
virtual filesystem.

This appears to have been harmless in the past, but after the change to
go/build in https://golang.org/cl/33158, it started to interfere with
the operation of godoc. The command godoc began to fail to resolve
relative import path "." in directories that exist, because the
incorrect IsDir implementation was looking in real filesystem, rather
than the virtual one:

	$ ./godoc fmt
	2017/03/04 18:59:50 cannot find package "." in:
		/target
	$ ./godoc -http=localhost:6060
	2017/03/04 19:00:07 cannot find package "." in:
		/src/fmt

Providing a custom implementation of IsDir that is aware of the h.c.fs
virtual filesystem, and performs a stat operation on the correct path
there resolves that problem. It also fixes the failing tests.

Additionally, because the exact error string returned from
Context.Import has changed after https://golang.org/cl/33158,
and now contains the text "package not found" rather than the
underlying error text from filesystem caused by a failed ReadDir
operation, the expected error message from "./godoc nonexistingpkg"
in a test needed to be updated to "cannot find package". It's no longer
dependent on the operating system.

It might be desirable to provide more relevant detail in the error
message from cmd/godoc when a package is not found, but that should be
determined and done in a followup CL. The scope of this one is to fix
normal functionality.

This change follows update to go/build in https://golang.org/cl/33158.

Helps golang/go#19401.

Change-Id: I00e2f746ec4a2fe7e640218adce75f15bdf29aaf
Reviewed-on: https://go-review.googlesource.com/37768
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-05 21:32:12 +00:00
Dmitri Shuralyov
a663d825ff cmd/godoc: Fix package comment inconsistencies.
Remove inadvertent and unwanted spaces in the middle of an
indented block.

Insert blank lines before indented sections for consistency.

Insert colon after "pointer" for consistency with "type".

Fixes golang/go#19356.

Change-Id: Iaae12f69d17adb51a27b516727c13132cb8df8e8
Reviewed-on: https://go-review.googlesource.com/37660
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Dominik Honnef <dominik@honnef.co>
Run-TryBot: Dominik Honnef <dominik@honnef.co>
2017-03-04 00:53:44 +00:00
David R. Jenni
e06694fefd x/tools/cmd/godoc: remove unused variable
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>
2017-03-01 14:52:40 +00:00
Ted Kornish
396c176f11 godoc: preserve ?m=... query string
Right now, clicking around packages in the godoc web interface strips
the URL of any query strings it may have, which makes traversing
internal packages a clumsy experience (constantly have to re-add ?m=...).

This revision preserves the ?m=... flag in links between packages by examining
the current PageInfoMode and converting it to a query string.

Change-Id: I4e28279d8cbf221bcc7d5bce8de04c90cc907678
Reviewed-on: https://go-review.googlesource.com/34982
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-08 21:12:11 +00:00
Hsin Tsao
f5bb18ad35 cmd/godoc: add better user error messages
Fixes golang/go#14280

Change-Id: I3151a17ce9553d0a7fe56c2d614e3a6f6a96344c
Reviewed-on: https://go-review.googlesource.com/36472
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-07 01:00:00 +00:00
Kevin Burke
cb538dbcf8 godoc: add README
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>
2017-01-09 19:14:34 +00:00
Russ Cox
908849c337 cmd/godoc: add perf subrepo
For golang/go#14304.

Change-Id: Ia90193d3a9ad027231f977ffa6b66cf60ea40683
Reviewed-on: https://go-review.googlesource.com/34615
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-12-20 20:09:41 +00:00
Brad Fitzpatrick
0f86c627e2 cmd/godoc: optional ACME autocert support
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>
2016-11-30 23:52:24 +00:00
Alan Donovan
242b5dc780 godoc: changes to support aliases
Fixes golang.org/go#17763

Change-Id: I18012dcfd878db916cbb940c3a361a89341b9209
Reviewed-on: https://go-review.googlesource.com/32711
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-03 21:57:37 +00:00
Brad Fitzpatrick
a2b1312ca0 cmd/godoc: increase test timeout
Darwin was flaking. Its HFS filesystem is probably too slow.

Change-Id: I44ea6de8dae8054d41c94c0c36e703e62fbdfcd9
Reviewed-on: https://go-review.googlesource.com/30954
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-10-12 16:04:38 +00:00
Brad Fitzpatrick
41f4ee4e59 cmd/godoc, cmd/fiximports: fix or skip failing tests at tip
Fix godoc test failure.

Skip fiximports test failure for now, to not hide other
failures. (tracking bug to fix properly in golang/go#17417)

x/tools being broken is preventing use of trybots for unrelated CLs.

Change-Id: I3a1deee4036096e0377cf8b63fabe444c58dd86e
Reviewed-on: https://go-review.googlesource.com/30953
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-10-12 15:24:30 +00:00
Mohit Agarwal
73d2e795b8 cmd/godoc: fix command for creating the zip file
The `-r` option (to recurse into directories) need to be specified
else the created file consists only of the specified directory and
nothing else.

Change-Id: I624184fc2e88998a3119c12f8c328603588c123c
Reviewed-on: https://go-review.googlesource.com/17283
Reviewed-by: Russ Cox <rsc@golang.org>
2016-10-04 20:51:58 +00:00
Andrew Gerrand
c9a2436076 cmd/godoc: set Strict-Transport-Security header in production
This coerces browsers into enforcing HTTPS-only for golang.org.

Change-Id: I91a4cc64b10b9836ef5623314a3cf22a54033dc2
Reviewed-on: https://go-review.googlesource.com/22673
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-02 17:22:30 +00:00
Larz Conwell
9a6ae37d4e cmd/godoc: accept GOOS and GOARCH URL parameters in -http mode
This allows users to change the GOOS/GOARCH without running their own
godoc server (or restarting with appropriate env vars).

Change-Id: I0b54ef1b2dd93cf2c965ca584d8df74119ed1be6
Reviewed-on: https://go-review.googlesource.com/1371
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-02-04 22:11:53 +00:00
Brad Fitzpatrick
b47dfd93e5 all: fix plan9 failures
Updates golang/go#11811

Change-Id: I6ed252eb3272354fce8084ec99f4777e41c3daa3
Reviewed-on: https://go-review.googlesource.com/18993
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2016-01-28 00:31:03 +00:00
Andrew Gerrand
9cd799205e cmd/godoc: add redirect for x/term repo
Update golang/go#13104

Change-Id: I76102038d8dc87503c9a8994f9008b1a9fdb19d4
Reviewed-on: https://go-review.googlesource.com/17020
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-11-18 05:08:28 +00:00
Andrew Gerrand
dec63b8e98 cmd/godoc: add x/time and x/sync redirects
Fixes golang/go#13133

Change-Id: I45031352d4d7c040889134310ad5721dd9dcc1ee
Reviewed-on: https://go-review.googlesource.com/16640
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-11-04 02:28:00 +00:00
Andrew Gerrand
10179a7e86 cmd/godoc: set Content-Type in fmt handler
Change-Id: I51b12838c65d67d4323e07d70f7c1e66fce23251
Reviewed-on: https://go-review.googlesource.com/14938
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-09-28 02:55:19 +00:00
Mhd Sulhan
2b5f3dc0de cmd/godoc: make setup-godoc-app.bash more portable
Unlike in BSD, in GNU/Linux find option for -depth is without an
argument. To make the command compatible in both system, use
-mindepth and -maxdepth arguments.

Change-Id: Ie82736fd2c28b6fe0f64dbfc7272f0e0f0d8e8df
Reviewed-on: https://go-review.googlesource.com/15014
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-09-27 06:24:22 +00:00
Andrew Gerrand
6b41c776c8 cmd/godoc: always serve fmt handler, HTTPS fix redirection
Change-Id: Ib00a54f40b3c52c9bc6a07623259c5c82f9d28d9
Reviewed-on: https://go-review.googlesource.com/14933
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-09-25 02:10:07 +00:00
Andrew Gerrand
c206e42859 cmd/godoc: serve proxy paths without host enforcer
Change-Id: I4647c1e18df3ea441c5220cd03fe6163794b7e84
Reviewed-on: https://go-review.googlesource.com/14862
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2015-09-23 05:23:18 +00:00
Andrew Gerrand
e83bc56334 godoc/{dl,proxy,short}: move packages out of Google's internal repo
These were built inside Google but have been in production for years.
Move them into the public tools repository so that they can be more
easily maintained.

This is step one to moving the entire golang.org deployment process out
of Google's internal source repository.

Change-Id: I72f875c5020b3f58f1c0cea1d19268e0f991833f
Reviewed-on: https://go-review.googlesource.com/14842
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2015-09-23 03:53:05 +00:00
Andrew Gerrand
40b1b219de cmd/godoc: restrict requests to HTTPS and canonical host names
Fixes golang/go#12684

Change-Id: Ibb49e604bfd92c902c9fd2bf9506ded60b2a9d8d
Reviewed-on: https://go-review.googlesource.com/14814
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-09-22 23:49:55 +00:00
Andrew Gerrand
31971b7521 godoc: fix source links for cmd/*
Fixes golang/go#12159

Change-Id: Id498443171cbdf0fe9808745a79edc863d836db1
Reviewed-on: https://go-review.googlesource.com/14001
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-09-11 00:20:26 +00:00
Andrew Gerrand
513c731aab cmd/godoc: add x/arch repo to list
Fixes golang/go#12393

Change-Id: I0b56c36dec11a6c2fddcc092867f24701815dce3
Reviewed-on: https://go-review.googlesource.com/14145
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-09-01 03:09:27 +00:00
Robert Griesemer
32dcbb4ccc cmd/godoc: exclude TestTypeAnalysis on Plan 9 for now
Attempt to make build work on Plan 9.

For golang/go#11811.

Change-Id: I37a5eaef441262342994a8f77c86aa5e120deea7
Reviewed-on: https://go-review.googlesource.com/13033
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-07-31 22:39:36 +00:00
Andrew Gerrand
d1eaf38956 cmd/godoc: don't run indexer test in -short mode
It takes too long for the builders.
Also remove GOPATH from the environment when indexing.

Change-Id: I9a3f2628f248bdbf9dce97119c2fbb7cbd63f3fe
Reviewed-on: https://go-review.googlesource.com/12917
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-07-31 05:12:20 +00:00
David Crawshaw
5c915edf62 cmd/godoc: redirect /x to subrepo page
Fixes golang/go#9061.

Change-Id: Ibe5764932bb8e223e7f838415f84bc330eb5d818
Reviewed-on: https://go-review.googlesource.com/12082
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-13 18:17:26 +00:00
Dave Cheney
0ee0dd6ea8 cmd/godoc: skip tests on arm platforms
Skip tests on arm platforms.

The godoc tests require large amounts of memory, in excess of 700mb in -index mode which none of the arm builders have spare.

Because of their requirements the tests can be killed by the test runner leaving stray godoc processes spinning in swap trying to -index.

Change-Id: I1544d56e9d9aabbbaac21adeebfb9e2690bd2da5
Reviewed-on: https://go-review.googlesource.com/7540
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-16 02:06:44 +00:00
Péter Surányi
8239116d59 cmd/godoc: exclude /pkg from search indexing
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.

Fixes golang/go#10024.

Change-Id: I0c69d22ff08d131f9c37c91a7711db6a4ec53fd4
Reviewed-on: https://go-review.googlesource.com/7267
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-12 00:26:38 +00:00
Péter Surányi
c327a7c00b cmd/godoc: add -index_interval
Updates golang/go#9996.

Change-Id: I6112b1c32832aaa6604b096cfe7a8833f092b17a
Reviewed-on: https://go-review.googlesource.com/7031
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-06 23:07:47 +00:00
Andrew Gerrand
88df7a741d cmd/godoc: add golang.org/x/tour meta redirect
Change-Id: I2b855bb166612af391bb99742f6b6d58bc3ec226
Reviewed-on: https://go-review.googlesource.com/4340
Reviewed-by: David Symonds <dsymonds@golang.org>
2015-02-10 05:48:21 +00:00
Andrew Gerrand
d702aaaabe cmd/godoc: add golang.org/x/build to go-import redirect list
Change-Id: Id372b2da716b31bc016855d2d7f783fd1764e5c0
Reviewed-on: https://go-review.googlesource.com/3110
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-21 06:59:18 +00:00
Hyang-Ah Hana Kim
e14d0b6f6b cmd/godoc: godoc test needs clean up tmp dir when buildGodoc fails.
Change-Id: I584ed27d37a85d39294b07febf396f567d4016a5
Reviewed-on: https://go-review.googlesource.com/2901
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-15 18:36:28 +00:00
Andrew Gerrand
af97332187 cmd/godoc: send go-source meta tag for golang.org/x repos
This allows godoc.org to link to the source code. I chose to link to
github.com instead of googlesource.com because their file browser is
better.

Details here:
864b1c0aba

Change-Id: I962b3fadc822e753245f52240937be5c7e158dc7
Reviewed-on: https://go-review.googlesource.com/2719
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-14 02:42:10 +00:00
Péter Surányi
bd69d2dd34 cmd/godoc: mention examples feature in godoc
Godoc documentation did not mention the feature for showing example code
runnable by the testing package. Add a link to the testing package.

Update golang/go#9471

Change-Id: Ic15794c59732e9b0b42c5b16c60be0a47c41afa5
Reviewed-on: https://go-review.googlesource.com/2490
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-01-08 02:02:02 +00:00
Andrew Gerrand
c836fe615a cmd/godoc: add golang.org/x/playground custom import path
Change-Id: Ic399dbf8a77e7c61ba8be263515b13a6b488b4e9
Reviewed-on: https://go-review.googlesource.com/2309
Reviewed-by: Rob Pike <r@golang.org>
2015-01-06 02:12:10 +00:00
Shenghou Ma
f72c7f7642 cmd/godoc: show the BUG section
This will match the default behavior when running locally.

In fact, our http://blog.golang.org/godoc-documenting-go-code explicitly
documents this feature (see also golang.org/cl/1953).

Change-Id: I581b17b60229ce70900cb51d548d1e2a34df41ba
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/2116
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-28 23:27:51 +00:00
Emil Hessman
864e280a1d cmd/godoc: add missing space to flag description
Change-Id: I8f4dada13353065475baf33c71e6e1a28f889e71
Reviewed-on: https://go-review.googlesource.com/1892
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2014-12-19 19:42:26 +00:00
Oling Cat
65b875be27 cmd/godoc: update GAE setup script
Change-Id: Ief2c49a03cbd3251d62d854be4f51dcb27a42458
Reviewed-on: https://go-review.googlesource.com/1522
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-19 02:48:01 +00:00
Brad Fitzpatrick
88d370fb93 cmd/godoc: add debug subrepo meta to x handler
Change-Id: I0ba56b32dd9b53d06817f9f7e2dafff04e6a86d2
Reviewed-on: https://go-review.googlesource.com/1565
Reviewed-by: David Symonds <dsymonds@golang.org>
2014-12-15 04:44:49 +00:00
David Symonds
24257c8cd2 tools: add import comments.
Change-Id: Idda6e64580432cb9a731e4ebf4005ee4ceb4202d
Reviewed-on: https://go-review.googlesource.com/1244
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 22:42:16 +00:00
Andrew Gerrand
9e66c59fb1 x/tools/cmd/godoc: update golang.org/x/ redirects to point to git repos
LGTM=dsymonds
R=dsymonds
CC=golang-codereviews
https://golang.org/cl/182620043
2014-12-08 10:30:52 +11:00
Andrew Gerrand
354b6ccbcc x/tools/cmd/godoc: add golang.org/x/oauth2 import path
LGTM=r
R=jbd, r
CC=golang-codereviews
https://golang.org/cl/175700043
2014-11-26 15:31:30 +11:00
Andrew Gerrand
4f9827a99d x/tools/cmd/godoc: fix bad repository path
Not caught by inattentive reviewer. Pick up your game, people.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/180880043
2014-11-19 15:51:44 +11:00
Andrew Gerrand
1536a92c03 x/tools/cmd/godoc: add golang.org/x/review custom import path
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/174410043
2014-11-19 14:03:19 +11:00
Andrew Gerrand
5ebbcd132f go.tools: use golang.org/x/... import paths
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
2014-11-10 08:50:40 +11:00
Andrew Gerrand
5d1cfb1968 go.tools/cmd/godoc: add handlers for new sub-repo paths
Fixes golang/go#9009.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/162470043
2014-10-31 09:01:52 +11:00
Alex Brainman
4bb917e48d go.tools/cmd/godoc: wait for godoc to exit before removing tmp directory
otherwise tmp directories do not get deleted on windows

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/166750043
2014-10-28 16:59:58 +11:00
Alex Brainman
d8b266df1c go.tools/cmd/godoc: wait for analysis to complete in TestTypeAnalysis
LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/157590043
2014-10-28 12:25:46 +11:00
Hana Kim
13837d25ef godoc: exclude internal packages and cmd from packages page.
Internal packages are now only included with ?m=all

Fixes golang/go#8879

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/155910044
2014-10-13 18:47:02 +02:00
Alan Donovan
6c93dbff3e go.tools/godoc: deal with fallout from $GOROOT/src/pkg -> $GOROOT/src renaming.
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
2014-09-10 09:02:54 -04:00
Andrew Gerrand
4aa650cf80 go.tools/cmd/godoc: register redirect handler for /dl/
LGTM=minux
R=golang-codereviews, gobot, bradfitz, minux
CC=golang-codereviews
https://golang.org/cl/107050044
2014-06-18 15:44:09 +10:00
Andrew Gerrand
5a5dc64a96 go.tools/godoc: fix index reading and writing
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
2014-06-13 16:49:32 +10:00
Andrew Gerrand
93b08999a7 go.tools/cmd/godoc: set corpus.MaxResults in appinit.go
LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/101220045
2014-06-13 15:20:15 +10:00
Rob Pike
6f17d00f0d go.tools: fix various minor issues found by go vet
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/96360048
2014-05-19 08:47:28 -07:00
Alex Brainman
d52b449ed7 go.tools/cmd/godoc: prevent duplicate GOROOT/GOPATH in environment in TestTypeAnalysis
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/94430044
2014-05-14 12:39:20 +10:00
Alan Donovan
4a9f74ad65 cmd/godoc: wait up to 500ms for results of -analysis=type.
(The test thread is racing with the analysis thread, which
takes around 4ms on this input.)

LGTM=gri
R=gri, bradfitz
CC=golang-codereviews
https://golang.org/cl/89780044
2014-04-21 17:56:06 -04:00
Alan Donovan
4843aaee02 godoc: add very basic integration test of godoc -analysis=type.
Also: fix careless regression introduced yesterday.

LGTM=bgarcia
R=bgarcia
CC=golang-codereviews
https://golang.org/cl/88880043
2014-04-17 15:51:27 -04:00
Alan Donovan
503140c72e godoc: documentation of -analysis features.
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
2014-04-16 16:35:08 -04:00
Alex Brainman
2961704231 go.tools/cmd/godoc: correct TestCLI match string on windows
Fixes golang/go#7707

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/84280045
2014-04-06 12:41:24 +10:00
Alan Donovan
7877131709 cmd/godoc: fix careless crash introduced by recent analysis CL
+ basic integration test

LGTM=bgarcia
R=bgarcia, bradfitz
CC=golang-codereviews
https://golang.org/cl/76410045
2014-03-16 16:17:13 -04:00
Alan Donovan
80c4f06c0f go.tools/godoc: server mode: add support for type and pointer analysis.
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
2014-03-14 18:58:22 -04:00
Brad Garcia
a81074af88 godoc: Output "No match found" only if there is no ast or docs included in info.
Fixes golang/go#7499.

R=minux.ma
CC=golang-codereviews
https://golang.org/cl/75400043
2014-03-14 10:00:10 -04:00
David du Colombier
ec0de5a8bc go.tools/cmd/godoc: fix test on Plan 9
LGTM=bradfitz
R=minux.ma, bradfitz
CC=golang-codereviews
https://golang.org/cl/70610044
2014-03-02 19:34:05 +01:00
Brad Garcia
aaca3a4f95 godoc: Remove bogus messages referring to "/target".
Fix package text display spacing.
Fixes golang/go#7395.

R=bradfitz, sameer
CC=golang-codereviews
https://golang.org/cl/68210043
2014-02-26 13:21:44 -05:00
Brad Garcia
d682175c6e godoc: test fixes for recent cmdline changes.
Tests broken by:
https://code.google.com/p/go/source/detail?r=1666da2583f4&repo=tools

R=gri, adonovan
CC=golang-codereviews
https://golang.org/cl/58780043
2014-01-30 15:32:23 -05:00
Brad Garcia
f97ec06d2c godoc: forward /pkg/C links to /cmd/cgo.
Fixes golang/go#5651.

R=bradfitz
CC=golang-codereviews
https://golang.org/cl/58660043
2014-01-30 07:07:12 -05:00
Brad Garcia
a28efa5d8c godoc: add ability to change or disable the display of search results.
The display of search results can now be changed. A slice of functions for displaying the results can now be provided.  By default, three functions are provided to display documentation, source code, and textual results.
This makes it possible to replace them with equivalents that, say,
obtain search results from alternative source code search engines.

R=bradfitz, adg
CC=golang-codereviews
https://golang.org/cl/43470043
2014-01-06 09:51:01 -05:00
Brad Fitzpatrick
59db975409 godoc: limit concurrency to local disk filesystem
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
2013-12-16 11:25:50 -08:00
Brad Garcia
f3faf8b6e0 godoc: add search results that point to documentation instead of source.
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
2013-11-21 11:55:42 -05:00
Brad Garcia
b844907f9f godoc: refactor command-line mode handling.
R=bradfitz
CC=golang-dev
https://golang.org/cl/29230044
2013-11-20 09:56:10 -05:00
Brad Fitzpatrick
626e9341d5 godoc: add forgotten file from last CL to fix build
R=adg, franciscossouza, dave
CC=golang-dev
https://golang.org/cl/25650043
2013-11-12 15:46:25 -08:00
Andrew Gerrand
36c288d6d7 go.tools/cmd/godoc: search go.tools/cmd before $GOROOT/cmd
Fixes golang/go#6527.

R=rsc
CC=golang-dev
https://golang.org/cl/14725043
2013-10-18 10:42:41 +09:00
Andrew Gerrand
7b481db506 go.tools/cmd/godoc: search go.tools/cmd for command docs
Update golang/go#6527

R=r, dsymonds
CC=golang-dev
https://golang.org/cl/14526053
2013-10-11 10:36:50 +09:00
Andrew Gerrand
dcad628c68 go.tools/cmd/blog: handle "/blog/" redirect properly
The redirect.PrefixHandler redirects "/foo/" to "/foo", which is what
we want in most cases ("/cl/", "/change/", etc) but not here.
So wrap it with a handler that handles "/blog/" explictly.

R=dsymonds
CC=golang-dev
https://golang.org/cl/14326043
2013-10-03 18:10:57 +10:00
Andrew Gerrand
3a3a765782 go.tools/cmd/godoc: fix app engine version; update build script and readme
R=golang-dev, dsymonds, bradfitz
CC=golang-dev
https://golang.org/cl/12897045
2013-10-03 14:29:16 +10:00
Russ Cox
1d95d02fef go.tools/cmd/godoc: point at doc.ToHTML documentation for formatting rules
Fixes golang/go#5429.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14292043
2013-10-02 22:08:24 -04:00
Andrew Gerrand
401293d22c go.tools/godoc: provide an explicit mux to register redirects
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/14199043
2013-10-02 13:13:34 +10:00
Andrew Gerrand
d20f86cc8e go.tools/godoc: move redirect helpers to new package
Update golang/go#6512

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/14193043
2013-10-01 16:32:13 +10:00
Andrew Gerrand
f54bd1aebf go.tools/cmd/godoc: update import paths
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13770043
2013-09-19 10:59:21 +10:00
Andrew Gerrand
072133c61b go.tools/cmd/godoc: include the blog server
Defer parsing of blog content until accessed for faster startup.
Fall back on redirect if blog content unavailable locally.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/13335052
2013-09-18 15:20:41 +10:00
Andrew Gerrand
dceff279d0 go.tools/cmd/godoc: add redirects for godoc, vet, and gotest
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13709046
2013-09-18 11:15:12 +10:00
Andrew Gerrand
b9b578154e go.tools/godoc: some content re-organization
Remove References section heading.
Add redirects from old paths to new content.
Add a link to the SubRepositories wiki page from package list.
Add styles for "pop-out" link.

R=r
CC=golang-dev
https://golang.org/cl/13356047
2013-09-16 15:46:38 +10:00
Andrew Gerrand
334d56a124 go.tools/cmd/godoc: permit dash and capitals in redirect paths
This was causing some /blog/foo-bar-baz paths to 404.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13640044
2013-09-16 13:02:15 +10:00
Andrew Gerrand
1564988897 go.tools/cmd/godoc: add redirect helpers
Previously these helpers were added by a private deployment script.
There's no reason why they shouldn't be part of godoc proper now
that it's in the go.tools repository.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13722043
2013-09-16 11:41:03 +10:00
Andrew Gerrand
2e6fbd84f8 go.tools/cmd/godoc: don't list factory functions under types in builtin package
Fixes golang/go#6220.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13094049
2013-08-28 09:39:02 +10:00
Brad Fitzpatrick
6f6897428a cmd/godoc: fix indexing
Use the flag.

Thanks to Travis Cline.

Fixes golang/go#6233

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13284044
2013-08-27 15:16:31 -07:00
Andrew Gerrand
373fd88c80 go.tools/cmd: move static files into new package 'static'
Fixes golang/go#6200.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12805046
2013-08-21 13:49:05 +10:00
Brad Fitzpatrick
7c5549876e cmd/godoc: don't parse HTML templates in command-line mode
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/12956044
2013-08-19 22:29:56 -07:00
Brad Fitzpatrick
1633383a2b cmd/godoc: don't start up indexer in command-line mode
Fixes golang/go#6075

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/12995044
2013-08-16 19:49:24 -07:00
Andrew Gerrand
32acd2b372 go.tools/cmd/godoc: redirect old pkg/cmd paths
fixes golang/go#5317.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12869046
2013-08-16 13:44:52 +10:00
Andrew Gerrand
562e4faeca cmd/godoc: bake templates and scripts into godoc binary
Add godoc/vfs/mapfs package for serving baked files.

Fixes golang/go#6010.

R=golang-dev, bradfitz, r, arnehormann, rsc
CC=golang-dev
https://golang.org/cl/12978043
2013-08-16 11:44:27 +10:00
Andrew Gerrand
8d55039560 go.tools/cmd/godoc: fix typo
R=golang-dev
CC=golang-dev
https://golang.org/cl/12238043
2013-08-01 17:43:31 +10:00
Andrew Gerrand
37c18cdcf3 go.tools/cmd/godoc: start indexer in app engine mode
R=golang-dev
CC=golang-dev
https://golang.org/cl/12237044
2013-08-01 17:37:20 +10:00
Andrew Gerrand
0830cbddc9 go.talks/cmd/godoc: add jquery.js and style.css
Somehow missed these.

R=golang-dev
CC=golang-dev
https://golang.org/cl/12233043
2013-08-01 17:36:56 +10:00
Andrew Gerrand
0afeff2d4b go.tools/cmd/godoc: add godocs.js and playground.js from core repo
The originals will be removed.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12219043
2013-08-01 15:08:46 +10:00
Andrew Gerrand
508186a765 go.tools/cmd/godoc: copy templates from $GOROOT/lib/godoc
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12209043
2013-08-01 11:01:10 +10:00
Brad Fitzpatrick
143d18d6c5 cmd/godoc: fix build
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/12127043
2013-07-30 13:42:50 -07:00
Andrew Gerrand
253974207b go.tools/cmd/godoc: update appinit.go to use new godoc packages
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
2013-07-30 14:23:23 +10:00