mirror of
https://github.com/golang/go
synced 2024-11-18 17:04:41 -07:00
80d38231f7
R=golang-dev, adg CC=golang-dev https://golang.org/cl/11540045
30 lines
891 B
Go
30 lines
891 B
Go
// Copyright 2010 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// The /doc/codewalk/ tree is synthesized from codewalk descriptions,
|
|
// files named $GOROOT/doc/codewalk/*.xml.
|
|
// For an example and a description of the format, see
|
|
// http://golang.org/doc/codewalk/codewalk or run godoc -http=:6060
|
|
// and see http://localhost:6060/doc/codewalk/codewalk .
|
|
// That page is itself a codewalk; the source code for it is
|
|
// $GOROOT/doc/codewalk/codewalk.xml.
|
|
|
|
package main
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"code.google.com/p/go.tools/godoc"
|
|
)
|
|
|
|
func registerHandlers(pres *godoc.Presentation) {
|
|
if pres == nil {
|
|
panic("nil Presentation")
|
|
}
|
|
http.HandleFunc("/doc/codewalk/", codewalk)
|
|
http.Handle("/doc/play/", pres.FileServer())
|
|
http.Handle("/robots.txt", pres.FileServer())
|
|
http.Handle("/", pres)
|
|
}
|