]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/godoc: remove extra / in paths
authorUgorji Nwoke <ugorji@gmail.com>
Mon, 5 Mar 2012 20:36:33 +0000 (15:36 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 5 Mar 2012 20:36:33 +0000 (15:36 -0500)
If I click on links which should send you to source code (e.g. type, function, etc),
the link is to //src/... (instead of /src/...).
This causes a DNS resolution failure on the browser.

Quick fix is to remove the leading / from package.html
(since godoc.go src links automatically add a leading / as necessary).

Fixes #3193.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5730059

lib/godoc/package.html

index c326e34cfc66b62481b5001505607b8d27e18726..e46300f6b638091924d763a0bb33d90f32b2dafc 100644 (file)
@@ -93,7 +93,7 @@
                {{range .Funcs}}
                        {{/* Name is a string - no need for FSet */}}
                        {{$name_html := html .Name}}
-                       <h2 id="{{$name_html}}">func <a href="/{{posLink_url .Decl $.FSet}}">{{$name_html}}</a></h2>
+                       <h2 id="{{$name_html}}">func <a href="{{posLink_url .Decl $.FSet}}">{{$name_html}}</a></h2>
                        <pre>{{node_html .Decl $.FSet}}</pre>
                        {{comment_html .Doc}}
                        {{example_html .Name $.Examples $.FSet}}
                {{range .Types}}
                        {{$tname := .Name}}
                        {{$tname_html := html .Name}}
-                       <h2 id="{{$tname_html}}">type <a href="/{{posLink_url .Decl $.FSet}}">{{$tname_html}}</a></h2>
+                       <h2 id="{{$tname_html}}">type <a href="{{posLink_url .Decl $.FSet}}">{{$tname_html}}</a></h2>
                        <pre>{{node_html .Decl $.FSet}}</pre>
                        {{comment_html .Doc}}
 
 
                        {{range .Funcs}}
                                {{$name_html := html .Name}}
-                               <h3 id="{{$name_html}}">func <a href="/{{posLink_url .Decl $.FSet}}">{{$name_html}}</a></h3>
+                               <h3 id="{{$name_html}}">func <a href="{{posLink_url .Decl $.FSet}}">{{$name_html}}</a></h3>
                                <pre>{{node_html .Decl $.FSet}}</pre>
                                {{comment_html .Doc}}
                                {{example_html .Name $.Examples $.FSet}}
 
                        {{range .Methods}}
                                {{$name_html := html .Name}}
-                               <h3 id="{{$tname_html}}.{{$name_html}}">func ({{html .Recv}}) <a href="/{{posLink_url .Decl $.FSet}}">{{$name_html}}</a></h3>
+                               <h3 id="{{$tname_html}}.{{$name_html}}">func ({{html .Recv}}) <a href="{{posLink_url .Decl $.FSet}}">{{$name_html}}</a></h3>
                                <pre>{{node_html .Decl $.FSet}}</pre>
                                {{comment_html .Doc}}
                                {{$name := printf "%s_%s" $tname .Name}}