1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/go-test.md

25 lines
596 B
Markdown
Raw Normal View History

# go test
> Tests Go packages (files have to end with `_test.go`).
> More information: <https://golang.org/cmd/go/#hdr-Testing_flags>.
- Test the package found in the current directory:
`go test`
- [v]erbosely test the package in the current directory:
`go test -v`
- 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}}`