diff --git a/cmd/godoc/x.go b/cmd/godoc/x.go index ed7c8d8a..1e609fbc 100644 --- a/cmd/godoc/x.go +++ b/cmd/godoc/x.go @@ -17,19 +17,25 @@ import ( const xPrefix = "/x/" -var xMap = map[string]string{ - "benchmarks": "https://code.google.com/p/go.benchmarks", - "blog": "https://code.google.com/p/go.blog", - "codereview": "https://code.google.com/p/go.codereview", - "crypto": "https://code.google.com/p/go.crypto", - "exp": "https://code.google.com/p/go.exp", - "image": "https://code.google.com/p/go.image", - "mobile": "https://code.google.com/p/go.mobile", - "net": "https://code.google.com/p/go.net", - "sys": "https://code.google.com/p/go.sys", - "talks": "https://code.google.com/p/go.talks", - "text": "https://code.google.com/p/go.text", - "tools": "https://code.google.com/p/go.tools", +type xRepo struct { + URL, VCS string +} + +var xMap = map[string]xRepo{ + "benchmarks": {"https://code.google.com/p/go.benchmarks", "hg"}, + "blog": {"https://code.google.com/p/go.blog", "hg"}, + "codereview": {"https://code.google.com/p/go.codereview", "hg"}, + "crypto": {"https://code.google.com/p/go.crypto", "hg"}, + "exp": {"https://code.google.com/p/go.exp", "hg"}, + "image": {"https://code.google.com/p/go.image", "hg"}, + "mobile": {"https://code.google.com/p/go.mobile", "hg"}, + "net": {"https://code.google.com/p/go.net", "hg"}, + "sys": {"https://code.google.com/p/go.sys", "hg"}, + "talks": {"https://code.google.com/p/go.talks", "hg"}, + "text": {"https://code.google.com/p/go.text", "hg"}, + "tools": {"https://code.google.com/p/go.tools", "hg"}, + + "review": {"https://go.googlecode.com/review", "git"}, } func init() { @@ -47,7 +53,8 @@ func xHandler(w http.ResponseWriter, r *http.Request) { return } data := struct { - Prefix, Head, Tail, Repo string + Prefix, Head, Tail string + Repo xRepo }{xPrefix, head, tail, repo} if err := xTemplate.Execute(w, data); err != nil { log.Println("xHandler:", err) @@ -58,7 +65,7 @@ var xTemplate = template.Must(template.New("x").Parse(`
- +