See 'go help importpath' for more about import paths.
See also: go build, go vet.
- `,
+`,
}
var helpTestflag = &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{
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
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
declaration, and no test or benchmark functions.
See the documentation of the testing package for more information.
- `,
+`,
}
var (