diff options
Diffstat (limited to 'src/cmd/godoc/template.go')
| -rw-r--r-- | src/cmd/godoc/template.go | 10 |
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) |
