commands.sh

go test

all

Test Go packages (files have to end with `_test.go`).

More info →

Examples (6)

Test the package found in the current directory

[v]erbosely test the package in the current directory

Test the packages in the current directory and all subdirectories (note the `...`)

go test -v ./...

Test the package in the current directory and run all benchmarks

go test -v -bench .

Test the package in the current directory and run all benchmarks for 50 seconds

go test -v -bench . -benchtime 50s

Test the package with coverage analysis

go test -cover
made by @shridhargupta | data from tldr-pages