The logic to determine whether a filesystem root was in GOROOT or GOPATH still relied on runtime.GOROOT(), whereas cmd/godoc was updated to copy the goroot finding logic from standard library. Hence, godoc is unable to determine if a filesystem is in GOROOT or not when the binary is outside runtime.GOROOT(). So we expose a new variable and set that from cmd/godoc to avoid copying the logic again for the 3rd time. Fixes golang/go#27162 Change-Id: I160dcdbdd262e671f09f7bf01c329be5eac280ad Reviewed-on: https://go-review.googlesource.com/130796 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit b43ba4d01e7b143a264aa4aa57a5abff6c8a1534) Reviewed-on: https://go-review.googlesource.com/131035 Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com> |
||
|---|---|---|
| .. | ||
| README.godoc-app | ||
| appinit.go | ||
| autocert.go | ||
| blog.go | ||
| codewalk.go | ||
| dl.go | ||
| doc.go | ||
| godoc19_test.go | ||
| godoc_test.go | ||
| goroot.go | ||
| handlers.go | ||
| index.go | ||
| main.go | ||
| play.go | ||
| remotesearch.go | ||
| setup-godoc-app.bash | ||
| x.go | ||
README.godoc-app
godoc on appengine ------------------ Prerequisites ------------- * Go appengine SDK https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Go * Go sources at tip under $GOROOT * Godoc sources at tip inside $GOPATH (go get -d golang.org/x/tools/cmd/godoc) Directory structure ------------------- * Let $APPDIR be the directory containing the app engine files. (e.g., $APPDIR=$HOME/godoc-app) * $APPDIR contains the following entries (this may change depending on app-engine release and version of godoc): app.yaml golang.org/x/tools/cmd/godoc godoc.zip index.split.* * The app.yaml file is set up per app engine documentation. For instance: application: godoc-app version: 1 runtime: go api_version: go1 handlers: - url: /.* script: _go_app Configuring and running godoc ----------------------------- To configure godoc, run bash setup-godoc-app.bash to prepare an $APPDIR as described above. See the script for details on usage. To run godoc locally, using the App Engine development server, run <path to go_appengine>/dev_appserver.py $APPDIR godoc should come up at http://localhost:8080 .