Skip to content

Files

godoc

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jan 29, 2025
Aug 16, 2022
Feb 18, 2025
Jan 29, 2025
Feb 18, 2025
Aug 2, 2017
Sep 24, 2019
May 5, 2023
Apr 15, 2018
Apr 12, 2022
Jan 29, 2025
Feb 18, 2025
Dec 12, 2023
Jan 29, 2025
Feb 15, 2017
Dec 12, 2023
Feb 12, 2021
Jan 31, 2023
Mar 12, 2021
May 28, 2019
Nov 20, 2019
Jan 29, 2025
Jan 29, 2025
Dec 12, 2023
Jul 17, 2018
Jan 29, 2025
Jun 25, 2018
Apr 12, 2022
Apr 27, 2015
Jan 29, 2025
Jan 3, 2025
Jan 3, 2025

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.