aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPéter Surányi <speter.go1@gmail.com>2015-02-28 12:16:22 +0900
committerAndrew Gerrand <adg@golang.org>2015-03-02 02:09:35 +0000
commit705f1dfb24353e2ea08365b033140fe6bc10bc63 (patch)
treecf29508a8e7be3fafa19b46a2240f049394b4f33
parent8913eaef7527f8112f65ce5c73f1282354de5fe0 (diff)
downloadtools-705f1dfb24353e2ea08365b033140fe6bc10bc63.tar.gz
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>
-rw-r--r--godoc/static/makestatic.go9
-rw-r--r--godoc/static/search.txt2
-rw-r--r--godoc/static/static.go14
3 files changed, 14 insertions, 11 deletions
diff --git a/godoc/static/makestatic.go b/godoc/static/makestatic.go
index b3b9c5f..f5e3272 100644
--- a/godoc/static/makestatic.go
+++ b/godoc/static/makestatic.go
@@ -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 //"
diff --git a/godoc/static/search.txt b/godoc/static/search.txt
index 15c1941..0ae0c08 100644
--- a/godoc/static/search.txt
+++ b/godoc/static/search.txt
@@ -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 */}}{{/*
diff --git a/godoc/static/static.go b/godoc/static/static.go
index 593d433..d3376ea 100644
--- a/godoc/static/static.go
+++ b/godoc/static/static.go
@@ -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 */}}{{/*