Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
5c7799f1
Commit
5c7799f1
authored
Feb 24, 2012
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go: fix help text documenting example functions
R=adg, r CC=golang-dev
https://golang.org/cl/5695062
parent
e303eeb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
src/cmd/go/test.go
src/cmd/go/test.go
+10
-7
No files found.
src/cmd/go/test.go
View file @
5c7799f1
...
...
@@ -76,7 +76,7 @@ flags are also accessible by 'go test'. See 'go help testflag' for details.
See 'go help importpath' for more about import paths.
See also: go build, go vet.
`
,
`
,
}
var
helpTestflag
=
&
Command
{
...
...
@@ -146,7 +146,7 @@ here are passed through unaltered. For instance, the command
will compile the test binary and then run it as
pkg.test -test.v -test.cpuprofile=prof.out -dir=testdata -update
`
,
`
,
}
var
helpTestfunc
=
&
Command
{
...
...
@@ -167,8 +167,10 @@ A benchmark function is one named BenchmarkXXX and should have the signature,
An example function is similar to a test function but, instead of using *testing.T
to report success or failure, prints output to os.Stdout and os.Stderr.
That output is compared against the function's doc comment.
An example without a doc comment is compiled but not executed.
That output is compared against the function's "Output:" comment, which
must be the last comment in the function body (see example below). An
example with no such comment, or with no text after "Output:" is compiled
but not executed.
Godoc displays the body of ExampleXXX to demonstrate the use
of the function, constant, or variable XXX. An example of a method M with
...
...
@@ -179,8 +181,9 @@ where xxx is a suffix not beginning with an upper case letter.
Here is an example of an example:
func ExamplePrintln() {
Println("The output of this example function.")
// Output: The output of this example function.
Println("The output of\nthis example.")
// Output: The output of
// this example.
}
The entire test file is presented as the example when it contains a single
...
...
@@ -188,7 +191,7 @@ example function, at least one other function, type, variable, or constant
declaration, and no test or benchmark functions.
See the documentation of the testing package for more information.
`
,
`
,
}
var
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment