fileServer http.Handler // default file server
cmdHandler docServer
pkgHandler docServer
+
+ // which code 'Notes' to show
+ notes = flag.String("notes", "BUG", "comma separated list of Note markers as per pkg:go/doc")
+ // list of 'Notes' to show
+ notesToShow []string
)
func initHandlers() {
+ notesToShow = strings.Split(*notes, ",")
+
fileServer = http.FileServer(&httpFS{fs})
cmdHandler = docServer{"/cmd/", "/src/cmd"}
pkgHandler = docServer{"/pkg/", "/src/pkg"}
// command-line searches
query = flag.Bool("q", false, "arguments are considered search queries")
-
- // which code 'Notes' to show.
- notes = flag.String("notes", "BUG", "comma separated list of Note markers as per pkg:go/doc")
- // vector of 'Notes' to show.
- notesToShow []string
)
func serveError(w http.ResponseWriter, r *http.Request, relpath string, err error) {
flag.Usage = usage
flag.Parse()
- notesToShow = strings.Split(*notes, ",")
-
// Check usage: either server and no args, command line and args, or index creation mode
if (*httpAddr != "" || *urlFlag != "") != (flag.NArg() == 0) && !*writeIndex {
usage()