From 35875c1a9260f19b90d4452fa3ec9ac26a0eee6d Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Tue, 22 Apr 2014 18:46:26 -0400 Subject: [PATCH] go.tools/cmd/godoc/static: fix text template for variable examples. Fixes golang/go#7771. LGTM=bgarcia R=golang-codereviews, bradfitz, bgarcia CC=golang-codereviews https://golang.org/cl/87180044 --- godoc/static/package.txt | 2 +- godoc/static/static.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/godoc/static/package.txt b/godoc/static/package.txt index ec4ef1cc4..868d06432 100644 --- a/godoc/static/package.txt +++ b/godoc/static/package.txt @@ -61,7 +61,7 @@ package {{.Name}} */}}{{if .Vars}}{{range .Vars}}{{node $ .Decl}} {{comment_text .Doc " " "\t"}} -{{example_text $ .Name " "}}{{end}}{{end}}{{/* +{{range $name := .Names}}{{example_text $ $name " "}}{{end}}{{end}}{{end}}{{/* --------------------------------------- diff --git a/godoc/static/static.go b/godoc/static/static.go index 874473827..42dfa0734 100644 --- a/godoc/static/static.go +++ b/godoc/static/static.go @@ -1869,7 +1869,7 @@ package {{.Name}} */}}{{if .Vars}}{{range .Vars}}{{node $ .Decl}} {{comment_text .Doc " " "\t"}} -{{example_text $ .Name " "}}{{end}}{{end}}{{/* +{{range $name := .Names}}{{example_text $ $name " "}}{{end}}{{end}}{{end}}{{/* ---------------------------------------