godoc/static: fix variable reference in search.txt

Change to match searchdoc.html which works.
(Was referring to "$val.Idents" in line 26, but "$val" here is
already an element of Idents.)
Also clarify naming and comments for makestatic.

Fixes golang/go#10022.

Change-Id: Ia3f2fdadd5d10f31a1825e8db966b6e92da2b93e
Reviewed-on: https://go-review.googlesource.com/6236
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
Péter Surányi 2015-02-28 12:16:22 +09:00 committed by Andrew Gerrand
parent 8913eaef75
commit 705f1dfb24
3 changed files with 14 additions and 11 deletions

View File

@ -4,8 +4,9 @@
// +build ignore // +build ignore
// Command bake reads a set of files and writes a Go source file to "static.go" // Command makestatic reads a set of files and writes a Go source file to "static.go"
// that declares a map of string constants containing contents of the input files. // that declares a map of string constants containing contents of the input files.
// It is intended to be invoked via "go generate" (directive in "gen.go").
package main package main
import ( import (
@ -70,13 +71,13 @@ var files = []string{
} }
func main() { func main() {
if err := bake(); err != nil { if err := makestatic(); err != nil {
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)
os.Exit(1) os.Exit(1)
} }
} }
func bake() error { func makestatic() error {
f, err := os.Create("static.go") f, err := os.Create("static.go")
if err != nil { if err != nil {
return err return err
@ -117,4 +118,4 @@ func sanitize(b []byte) []byte {
return bytes.Replace(b, []byte("\xEF\xBB\xBF"), []byte("`+\"\\xEF\\xBB\\xBF\"+`"), -1) return bytes.Replace(b, []byte("\xEF\xBB\xBF"), []byte("`+\"\\xEF\\xBB\\xBF\"+`"), -1)
} }
const warning = "// DO NOT EDIT ** This file was generated with the bake tool ** DO NOT EDIT //" const warning = "// DO NOT EDIT ** This file was generated by \"go generate\" ** DO NOT EDIT //"

View File

@ -23,7 +23,7 @@ QUERY
--------------------------------------- ---------------------------------------
*/}}{{range $key, $val := .Idents}}{{if $val}}{{$key.Name}} */}}{{range $key, $val := .Idents}}{{if $val}}{{$key.Name}}
{{range $val.Idents}} {{.Path}}.{{.Name}} {{range $val}} {{.Path}}.{{.Name}}
{{end}} {{end}}
{{end}}{{end}}{{/* .Idents */}}{{/* {{end}}{{end}}{{/* .Idents */}}{{/*

View File

@ -1,4 +1,4 @@
// DO NOT EDIT ** This file was generated with the bake tool ** DO NOT EDIT // // DO NOT EDIT ** This file was generated by "go generate" ** DO NOT EDIT //
package static package static
@ -98,7 +98,8 @@ var Files = map[string]string{
<p> <p>
Clicking on the identifier that defines a named type causes a panel Clicking on the identifier that defines a named type causes a panel
to appear, displaying information about the named type, including to appear, displaying information about the named type, including
its size and alignment in bytes, its <a href='http://golang.org/ref/spec#Method_sets'>method set</a>, and its its size and alignment in bytes, its
<a href='http://golang.org/ref/spec#Method_sets'>method set</a>, and its
<i>implements</i> relation: the set of types T that are assignable to <i>implements</i> relation: the set of types T that are assignable to
or from this type U where at least one of T or U is an interface. or from this type U where at least one of T or U is an interface.
@ -272,7 +273,7 @@ var Files = map[string]string{
<span class='err'></span> All analysis results pertain to exactly <span class='err'></span> All analysis results pertain to exactly
one configuration (e.g. amd64 linux). Files that are conditionally one configuration (e.g. amd64 linux). Files that are conditionally
compiled based on different platforms or build tags are not visible compiled based on different platforms or build tags are not visible
to the analysis.</br> to the analysis.<br/>
<span class='err'></span> Files that <code>import "C"</code> require <span class='err'></span> Files that <code>import "C"</code> require
preprocessing by the cgo tool. The file offsets after preprocessing preprocessing by the cgo tool. The file offsets after preprocessing
@ -280,9 +281,10 @@ var Files = map[string]string{
<span class='err'></span> Files are not periodically re-analyzed. <span class='err'></span> Files are not periodically re-analyzed.
If the files change underneath the running server, the displayed If the files change underneath the running server, the displayed
markup is misaligned.</br> markup is misaligned.<br/>
<span class='err'></span> Additional issues are listed at <a href='https://code.google.com/p/go/source/browse/godoc/analysis/README?repo=tools'>go.tools/godoc/analysis/README</a>.</br> <span class='err'></span> Additional issues are listed at
<a href='https://go.googlesource.com/tools/+/master/godoc/analysis/README'>tools/godoc/analysis/README</a>.<br/>
</p> </p>
`, `,
@ -2523,7 +2525,7 @@ function PlaygroundOutput(el) {
--------------------------------------- ---------------------------------------
*/}}{{range $key, $val := .Idents}}{{if $val}}{{$key.Name}} */}}{{range $key, $val := .Idents}}{{if $val}}{{$key.Name}}
{{range $val.Idents}} {{.Path}}.{{.Name}} {{range $val}} {{.Path}}.{{.Name}}
{{end}} {{end}}
{{end}}{{end}}{{/* .Idents */}}{{/* {{end}}{{end}}{{/* .Idents */}}{{/*