summaryrefslogtreecommitdiff
path: root/src/pkg/text/template/example_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/text/template/example_test.go')
-rw-r--r--src/pkg/text/template/example_test.go46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/pkg/text/template/example_test.go b/src/pkg/text/template/example_test.go
index b7701ea26..ad49514a8 100644
--- a/src/pkg/text/template/example_test.go
+++ b/src/pkg/text/template/example_test.go
@@ -10,28 +10,6 @@ import (
"text/template"
)
-// Dear Aunt Mildred,
-//
-// It was a pleasure to see you at the wedding.
-// Thank you for the lovely bone china tea set.
-//
-// Best wishes,
-// Josie
-//
-// Dear Uncle John,
-//
-// It is a shame you couldn't make it to the wedding.
-// Thank you for the lovely moleskin pants.
-//
-// Best wishes,
-// Josie
-//
-// Dear Cousin Rodney,
-//
-// It is a shame you couldn't make it to the wedding.
-//
-// Best wishes,
-// Josie
func ExampleTemplate() {
// Define a template.
const letter = `
@@ -66,4 +44,28 @@ Josie
log.Println("executing template:", err)
}
}
+
+ // Output:
+ // Dear Aunt Mildred,
+ //
+ // It was a pleasure to see you at the wedding.
+ // Thank you for the lovely bone china tea set.
+ //
+ // Best wishes,
+ // Josie
+ //
+ // Dear Uncle John,
+ //
+ // It is a shame you couldn't make it to the wedding.
+ // Thank you for the lovely moleskin pants.
+ //
+ // Best wishes,
+ // Josie
+ //
+ // Dear Cousin Rodney,
+ //
+ // It is a shame you couldn't make it to the wedding.
+ //
+ // Best wishes,
+ // Josie
}