mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
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:
parent
8913eaef75
commit
705f1dfb24
@ -4,8 +4,9 @@
|
||||
|
||||
// +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.
|
||||
// It is intended to be invoked via "go generate" (directive in "gen.go").
|
||||
package main
|
||||
|
||||
import (
|
||||
@ -70,13 +71,13 @@ var files = []string{
|
||||
}
|
||||
|
||||
func main() {
|
||||
if err := bake(); err != nil {
|
||||
if err := makestatic(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func bake() error {
|
||||
func makestatic() error {
|
||||
f, err := os.Create("static.go")
|
||||
if err != nil {
|
||||
return err
|
||||
@ -117,4 +118,4 @@ func sanitize(b []byte) []byte {
|
||||
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 //"
|
||||
|
@ -23,7 +23,7 @@ QUERY
|
||||
---------------------------------------
|
||||
|
||||
*/}}{{range $key, $val := .Idents}}{{if $val}}{{$key.Name}}
|
||||
{{range $val.Idents}} {{.Path}}.{{.Name}}
|
||||
{{range $val}} {{.Path}}.{{.Name}}
|
||||
{{end}}
|
||||
{{end}}{{end}}{{/* .Idents */}}{{/*
|
||||
|
||||
|
@ -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
|
||||
|
||||
@ -98,7 +98,8 @@ var Files = map[string]string{
|
||||
<p>
|
||||
Clicking on the identifier that defines a named type causes a panel
|
||||
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
|
||||
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
|
||||
one configuration (e.g. amd64 linux). Files that are conditionally
|
||||
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
|
||||
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.
|
||||
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>
|
||||
`,
|
||||
|
||||
@ -2523,7 +2525,7 @@ function PlaygroundOutput(el) {
|
||||
---------------------------------------
|
||||
|
||||
*/}}{{range $key, $val := .Idents}}{{if $val}}{{$key.Name}}
|
||||
{{range $val.Idents}} {{.Path}}.{{.Name}}
|
||||
{{range $val}} {{.Path}}.{{.Name}}
|
||||
{{end}}
|
||||
{{end}}{{end}}{{/* .Idents */}}{{/*
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user