summaryrefslogtreecommitdiff
path: root/src/cmd/godoc/template.go
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@debian.org>2013-03-04 21:27:36 +0100
committerMichael Stapelberg <michael@stapelberg.de>2013-03-04 21:27:36 +0100
commit04b08da9af0c450d645ab7389d1467308cfc2db8 (patch)
treedb247935fa4f2f94408edc3acd5d0d4f997aa0d8 /src/cmd/godoc/template.go
parent917c5fb8ec48e22459d77e3849e6d388f93d3260 (diff)
downloadgolang-04b08da9af0c450d645ab7389d1467308cfc2db8.tar.gz
Imported Upstream version 1.1~hg20130304upstream/1.1_hg20130304
Diffstat (limited to 'src/cmd/godoc/template.go')
-rw-r--r--src/cmd/godoc/template.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/godoc/template.go b/src/cmd/godoc/template.go
index d709baef4..7b9b9cfeb 100644
--- a/src/cmd/godoc/template.go
+++ b/src/cmd/godoc/template.go
@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.
// Template support for writing HTML documents.
-// Documents that include Template: true in their
+// Documents that include Template: true in their
// metadata are executed as input to text/template.
//
// This file defines functions for those templates to invoke.
@@ -57,8 +57,8 @@ func contents(name string) string {
return string(file)
}
-// format returns a textual representation of the arg, formatted according to its nature.
-func format(arg interface{}) string {
+// stringFor returns a textual representation of the arg, formatted according to its nature.
+func stringFor(arg interface{}) string {
switch arg := arg.(type) {
case int:
return fmt.Sprintf("%d", arg)
@@ -87,10 +87,10 @@ func code(file string, arg ...interface{}) (s string, err error) {
// text is already whole file.
command = fmt.Sprintf("code %q", file)
case 1:
- command = fmt.Sprintf("code %q %s", file, format(arg[0]))
+ command = fmt.Sprintf("code %q %s", file, stringFor(arg[0]))
text = oneLine(file, text, arg[0])
case 2:
- command = fmt.Sprintf("code %q %s %s", file, format(arg[0]), format(arg[1]))
+ command = fmt.Sprintf("code %q %s %s", file, stringFor(arg[0]), stringFor(arg[1]))
text = multipleLines(file, text, arg[0], arg[1])
default:
return "", fmt.Errorf("incorrect code invocation: code %q %q", file, arg)