diff --git a/cmd/godoc/godoc_test.go b/cmd/godoc/godoc_test.go index 8988be09aa..65db45596e 100644 --- a/cmd/godoc/godoc_test.go +++ b/cmd/godoc/godoc_test.go @@ -28,8 +28,8 @@ var godocTests = []struct { { []string{"io", "WriteString"}, []string{ - `import "io"`, `func WriteString\(`, + `WriteString writes the contents of the string s to w`, }, }, } diff --git a/godoc/cmdline_test.go b/godoc/cmdline_test.go index 52c706d252..a39ef8c371 100644 --- a/godoc/cmdline_test.go +++ b/godoc/cmdline_test.go @@ -183,8 +183,8 @@ package main p.cmdHandler = handlerServer{p, c, "/cmd/", "/src/cmd"} p.pkgHandler = handlerServer{p, c, "/pkg/", "/src/pkg"} p.initFuncMap() - p.PackageText = template.Must(template.New("PackageText").Funcs(p.FuncMap()).Parse(`{{with .PAst}}{{range $filename, $ast := .}}{{$filename}}: -{{node $ $ast}}{{end}}{{end}}{{with .PDoc}}{{if $.IsMain}}COMMAND {{.Doc}}{{else}}PACKAGE {{.Doc}}{{end}}{{with .Funcs}} + p.PackageText = template.Must(template.New("PackageText").Funcs(p.FuncMap()).Parse(`{{$info := .}}{{$filtered := .IsFiltered}}{{if $filtered}}{{range .PAst}}{{range .Decls}}{{node $info .}}{{end}}{{end}}{{else}}{{with .PAst}}{{range $filename, $ast := .}}{{$filename}}: +{{node $ $ast}}{{end}}{{end}}{{end}}{{with .PDoc}}{{if $.IsMain}}COMMAND {{.Doc}}{{else}}PACKAGE {{.Doc}}{{end}}{{with .Funcs}} {{range .}}{{node $ .Decl}} {{comment_text .Doc " " "\t"}}{{end}}{{end}}{{end}}`))