diff --git a/lib/godoc/package.html b/lib/godoc/package.html
index 5a7f3ef976d..d84c1c1e7f5 100644
--- a/lib/godoc/package.html
+++ b/lib/godoc/package.html
@@ -20,8 +20,7 @@
{{node_html .Decl $.FSet}}
{{end}}
{{range .Types}}
- {{$tname := printf "%s" .Type.Name}}
- {{$tname_html := node_html .Type.Name $.FSet}}
+ {{$tname_html := html .Name}}
type {{$tname_html}}
{{range .Funcs}}
{{$name_html := html .Name}}
@@ -86,8 +85,8 @@
{{example_html .Name $.Examples $.FSet}}
{{end}}
{{range .Types}}
- {{$tname := printf "%s" .Type.Name}}
- {{$tname_html := node_html .Type.Name $.FSet}}
+ {{$tname := .Name}}
+ {{$tname_html := html .Name}}
{{comment_html .Doc}}
{{node_html .Decl $.FSet}}