summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gerrand <adg@golang.org>2013-11-13 14:35:59 +1100
committerAndrew Gerrand <adg@golang.org>2013-11-13 14:35:59 +1100
commitb5982825bed67aaa1bf01f765fcc4448ca05858b (patch)
tree1f55c1689a97b7e5f5d2c5272b870117d58b09df
parent4b2350ddabd71481d369f2fc39dd9f584ddb6451 (diff)
downloadgo-b5982825bed67aaa1bf01f765fcc4448ca05858b.tar.gz
[release-branch.go1.2] cmd/godoc: document package-level examples
??? CL 23940043 / 6ad0ec54cf2d cmd/godoc: document package-level examples Fixes issue 5807 . R=golang-dev, adg CC=golang-dev https://codereview.appspot.com/23940043 Committer: Andrew Gerrand <adg@golang.org> ??? R=golang-dev CC=golang-dev https://codereview.appspot.com/25500045
-rw-r--r--src/pkg/testing/testing.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pkg/testing/testing.go b/src/pkg/testing/testing.go
index 5019e0762..52dc166dd 100644
--- a/src/pkg/testing/testing.go
+++ b/src/pkg/testing/testing.go
@@ -73,17 +73,19 @@
//
// Example functions without output comments are compiled but not executed.
//
-// The naming convention to declare examples for a function F, a type T and
+// The naming convention to declare examples for the package, a function F, a type T and
// method M on type T are:
//
+// func Example() { ... }
// func ExampleF() { ... }
// func ExampleT() { ... }
// func ExampleT_M() { ... }
//
-// Multiple example functions for a type/function/method may be provided by
+// Multiple example functions for a package/type/function/method may be provided by
// appending a distinct suffix to the name. The suffix must start with a
// lower-case letter.
//
+// func Example_suffix() { ... }
// func ExampleF_suffix() { ... }
// func ExampleT_suffix() { ... }
// func ExampleT_M_suffix() { ... }