Andrew Bonventre 70252dea49 Revert "godoc: init corpus in a separate goroutine in http mode"
This reverts commit f86b507a7e91633e9ed99e4071f91a62e78f05f6.

Reason for revert: broke tests in tools repo

Change-Id: Id7e5d8e050896b6f5fedaee705be8a5f9adf4bf3
Reviewed-on: https://go-review.googlesource.com/93115
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-02-09 17:03:34 +00:00
..
2017-06-13 17:41:52 +00:00
2014-12-09 22:42:16 +00:00
2015-04-27 04:29:37 +00:00
2017-02-28 14:15:42 +00:00
2017-02-15 21:42:32 +00:00
2017-01-09 19:59:23 +00:00
2017-08-02 21:09:52 +00:00
2015-04-27 04:29:37 +00:00

godoc

This directory contains most of the code for running a godoc server. The executable lives at golang.org/x/tools/cmd/godoc.

Development mode

In production, CSS/JS/template assets need to be compiled into the godoc binary. It can be tedious to recompile assets every time, but you can pass a flag to load CSS/JS/templates from disk every time a page loads:

godoc -templates=$GOPATH/src/golang.org/x/tools/godoc/static -http=:6060

Recompiling static assets

The files that live at static/style.css, static/jquery.js and so on are not present in the final binary. They are placed into static/static.go by running go generate. So to compile a change and test it in your browser:

  1. Make changes to e.g. static/style.css.

  2. Run go generate golang.org/x/tools/godoc/static so static/static.go picks up the change.

  3. Run go install golang.org/x/tools/cmd/godoc so the compiled godoc binary picks up the change.

  4. Run godoc -http=:6060 and view your changes in the browser. You may need to disable your browser's cache to avoid reloading a stale file.