summaryrefslogtreecommitdiff
path: root/src/cmd/godoc
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2010-03-02 13:46:51 -0800
committerRobert Griesemer <gri@golang.org>2010-03-02 13:46:51 -0800
commit10f55215a4d4ac643bf04202704b4fec01417bba (patch)
treee6032529c69dbf4925dc7da8a0641ff6bb264b3d /src/cmd/godoc
parentedc1c5e40d5b639a38b7a0b7484d51edab3bcb62 (diff)
downloadgolang-10f55215a4d4ac643bf04202704b4fec01417bba.tar.gz
gofmt: experiment: align values in map composites where possible
- gofmt -w src misc - looking for feedback R=rsc, r CC=golang-dev http://codereview.appspot.com/223076
Diffstat (limited to 'src/cmd/godoc')
-rw-r--r--src/cmd/godoc/godoc.go52
-rw-r--r--src/cmd/godoc/index.go2
2 files changed, 27 insertions, 27 deletions
diff --git a/src/cmd/godoc/godoc.go b/src/cmd/godoc/godoc.go
index c6438245e..5b85af870 100644
--- a/src/cmd/godoc/godoc.go
+++ b/src/cmd/godoc/godoc.go
@@ -689,13 +689,13 @@ func urlFmt(w io.Writer, x interface{}, format string) {
// The strings in infoKinds must be properly html-escaped.
var infoKinds = [nKinds]string{
PackageClause: "package&nbsp;clause",
- ImportDecl: "import&nbsp;decl",
- ConstDecl: "const&nbsp;decl",
- TypeDecl: "type&nbsp;decl",
- VarDecl: "var&nbsp;decl",
- FuncDecl: "func&nbsp;decl",
- MethodDecl: "method&nbsp;decl",
- Use: "use",
+ ImportDecl: "import&nbsp;decl",
+ ConstDecl: "const&nbsp;decl",
+ TypeDecl: "type&nbsp;decl",
+ VarDecl: "var&nbsp;decl",
+ FuncDecl: "func&nbsp;decl",
+ MethodDecl: "method&nbsp;decl",
+ Use: "use",
}
@@ -762,20 +762,20 @@ func localnameFmt(w io.Writer, x interface{}, format string) {
var fmap = template.FormatterMap{
- "": textFmt,
- "html": htmlFmt,
- "html-esc": htmlEscFmt,
+ "": textFmt,
+ "html": htmlFmt,
+ "html-esc": htmlEscFmt,
"html-comment": htmlCommentFmt,
- "url-pkg": urlFmt,
- "url-src": urlFmt,
- "url-pos": urlFmt,
- "infoKind": infoKindFmt,
- "infoLine": infoLineFmt,
- "infoSnippet": infoSnippetFmt,
- "padding": paddingFmt,
- "time": timeFmt,
- "dir/": dirslashFmt,
- "localname": localnameFmt,
+ "url-pkg": urlFmt,
+ "url-src": urlFmt,
+ "url-pos": urlFmt,
+ "infoKind": infoKindFmt,
+ "infoLine": infoLineFmt,
+ "infoSnippet": infoSnippetFmt,
+ "padding": paddingFmt,
+ "time": timeFmt,
+ "dir/": dirslashFmt,
+ "localname": localnameFmt,
}
@@ -828,12 +828,12 @@ func servePage(c *http.Conn, title, query string, content []byte) {
_, ts := fsTree.get()
d := Data{
- Title: title,
- PkgRoots: fsMap.PrefixList(),
+ Title: title,
+ PkgRoots: fsMap.PrefixList(),
Timestamp: uint64(ts) * 1e9, // timestamp in ns
- Query: query,
- Menu: nil,
- Content: content,
+ Query: query,
+ Menu: nil,
+ Content: content,
}
if err := godocHTML.Execute(&d, c); err != nil {
@@ -935,7 +935,7 @@ func redirect(c *http.Conn, r *http.Request) (redirected bool) {
// textExt[x] is true if the extension x indicates a text file, and false otherwise.
var textExt = map[string]bool{
".css": false, // must be served raw
- ".js": false, // must be served raw
+ ".js": false, // must be served raw
}
diff --git a/src/cmd/godoc/index.go b/src/cmd/godoc/index.go
index 01ec29878..d6fdba15d 100644
--- a/src/cmd/godoc/index.go
+++ b/src/cmd/godoc/index.go
@@ -647,7 +647,7 @@ func NewIndex(root string) *Index {
decls := reduce(&h.Decls)
others := reduce(&h.Others)
words[w] = &LookupResult{
- Decls: decls,
+ Decls: decls,
Others: others,
}
wlist.Push(&wordPair{canonical(w), w})