From 705f1dfb24353e2ea08365b033140fe6bc10bc63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Sur=C3=A1nyi?= Date: Sat, 28 Feb 2015 12:16:22 +0900 Subject: [PATCH] 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 Reviewed-by: Andrew Gerrand --- godoc/static/makestatic.go | 9 +++++---- godoc/static/search.txt | 2 +- godoc/static/static.go | 14 ++++++++------ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/godoc/static/makestatic.go b/godoc/static/makestatic.go index b3b9c5f6..f5e32725 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 15c1941b..0ae0c080 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 593d4333..d3376eaf 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{

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 method set, and its + its size and alignment in bytes, its + method set, and its implements 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{ 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.
+ to the analysis.
Files that import "C" require preprocessing by the cgo tool. The file offsets after preprocessing @@ -280,9 +281,10 @@ var Files = map[string]string{ Files are not periodically re-analyzed. If the files change underneath the running server, the displayed - markup is misaligned.
+ markup is misaligned.
- Additional issues are listed at go.tools/godoc/analysis/README.
+ Additional issues are listed at + tools/godoc/analysis/README.

`, @@ -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 */}}{{/*