debian man page for go-testfunc

Query: go-testfunc

OS: debian

Section: 7

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

GO-TESTFUNC(7)						 Miscellaneous Information Manual					    GO-TESTFUNC(7)

NAME
go - tool for managing Go source code
DESCRIPTION
The 'go test' command expects to find test, benchmark, and example functions in the "*_test.go" files corresponding to the package under test. A test function is one named TestXXX (where XXX is any alphanumeric string not starting with a lower case letter) and should have the sig- nature, func TestXXX(t *testing.T) { ... } A benchmark function is one named BenchmarkXXX and should have the signature, func BenchmarkXXX(b *testing.B) { ... } 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 "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 receiver type T or *T is named ExampleT_M. There may be multiple examples for a given function, constant, or variable, distinguished by a trailing _xxx, 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.") // Output: The output of // this example. } The entire test file is presented as the example when it contains a single 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.
AUTHOR
This manual page was written by Michael Stapelberg <stapelberg@debian.org>, for the Debian project (and may be used by others). 2012-05-13 GO-TESTFUNC(7)
Related Man Pages
go-clean(1) - debian
go-test(1) - debian
go(1) - debian
while(1) - redhat
test::inline::section(3pm) - debian
Similar Topics in the Unix Linux Community
Redirect question
Use sed to merge multiple lines
Using iozone for testing solid state drives
Prefixing test case methods with letter 'test'
Shc : trying to test functionality &quot;test&quot; compiling but can not execute