~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/cmd/godoc/appinit.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
)
18
18
 
19
19
func serveError(w http.ResponseWriter, r *http.Request, relpath string, err error) {
20
 
        contents := applyTemplate(errorHTML, "errorHTML", err) // err may contain an absolute path!
21
20
        w.WriteHeader(http.StatusNotFound)
22
 
        servePage(w, relpath, "File "+relpath, "", "", contents)
 
21
        servePage(w, Page{
 
22
                Title:    "File " + relpath,
 
23
                Subtitle: relpath,
 
24
                Body:     applyTemplate(errorHTML, "errorHTML", err), // err may contain an absolute path!
 
25
        })
23
26
}
24
27
 
25
28
func init() {
34
37
        *indexFiles = indexFilenames
35
38
        *maxResults = 100    // reduce latency by limiting the number of fulltext search results
36
39
        *indexThrottle = 0.3 // in case *indexFiles is empty (and thus the indexer is run)
 
40
        *showPlayground = true
37
41
 
38
42
        // read .zip file and set up file systems
39
43
        const zipfile = zipFilename
48
52
        readTemplates()
49
53
        initHandlers()
50
54
        registerPublicHandlers(http.DefaultServeMux)
 
55
        registerPlaygroundHandlers(http.DefaultServeMux)
51
56
 
52
57
        // initialize default directory tree with corresponding timestamp.
53
58
        initFSTree()