_test.go file

A Go source file whose name ends in _test.go, which holds tests and is compiled only by go test, never into your binary.

In more detail

Put it next to the code it tests, in the same package. go test gathers every such file in the package into a temporary test binary.

Example

check_test.go

Related terms

Taught in

References