diff options
| author | Michael Stapelberg <stapelberg@debian.org> | 2013-03-04 21:27:43 +0100 |
|---|---|---|
| committer | Michael Stapelberg <michael@stapelberg.de> | 2013-03-04 21:27:43 +0100 |
| commit | ad47422646a18ffcb47cec916ef7393c923f2e76 (patch) | |
| tree | 7c7861fb3d9539d61c1dcfd5b8dadee974c25760 /src/cmd/godoc/template.go | |
| parent | 2c8d5d584a79781ca41bb6f4b396893fbbac5b97 (diff) | |
| parent | 04b08da9af0c450d645ab7389d1467308cfc2db8 (diff) | |
| download | golang-ad47422646a18ffcb47cec916ef7393c923f2e76.tar.gz | |
Merge tag 'upstream/1.1_hg20130304' into debian-sid
Upstream version 1.1~hg20130304
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) |
