Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/goPublic

Commit021476d

Browse files
committed
[release-branch.go1.2] cmd/godoc: document package-level examples
««« CL 23940043 / 6ad0ec54cf2dcmd/godoc: document package-level examplesFixes issue 5807 .R=golang-dev, adgCC=golang-devhttps://golang.org/cl/23940043»»»R=golang-devCC=golang-devhttps://golang.org/cl/25500045
1 parent1c96199 commit021476d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/pkg/testing/testing.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,19 @@
7373
//
7474
// Example functions without output comments are compiled but not executed.
7575
//
76-
// The naming convention to declare examples for a function F, a type T and
76+
// The naming convention to declare examples forthe package,a function F, a type T and
7777
// method M on type T are:
7878
//
79+
// func Example() { ... }
7980
// func ExampleF() { ... }
8081
// func ExampleT() { ... }
8182
// func ExampleT_M() { ... }
8283
//
83-
// Multiple example functions for a type/function/method may be provided by
84+
// Multiple example functions for apackage/type/function/method may be provided by
8485
// appending a distinct suffix to the name. The suffix must start with a
8586
// lower-case letter.
8687
//
88+
// func Example_suffix() { ... }
8789
// func ExampleF_suffix() { ... }
8890
// func ExampleT_suffix() { ... }
8991
// func ExampleT_M_suffix() { ... }

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp