- Home
- Unit Testing
- Go testing
Go testing
What it is
Go testing is the lightweight test framework included with Go, an open-source programming language supported by Google. Developers run it with the `go test` command and the `testing` package. The framework finds test functions named `TestXXX` in files ending in `_test.go`; adding `-v` displays each test and its result. The standard toolchain also supports native fuzzing, which varies program inputs to look for bugs, plus built-in benchmarking and profiling. For concurrency checks, `go test -race` enables a race detector, though it can only find races in code paths that execute. The `govulncheck` tool identifies known vulnerabilities and prioritizes findings according to whether affected functions or methods are called; its JSON output can support CI/CD integration, and the Go team provides a GitHub Action. Go is free and available for Linux, macOS, and Windows. Its broader use cases include cloud and network services, command-line interfaces, web development, DevOps, and site reliability engineering.
For and against
For
- Free, open-source language and testing framework.
- Discovers `TestXXX` functions in `_test.go` files.
- Includes native fuzzing, benchmarking, and profiling.
- `govulncheck` can prioritize findings by affected code.
- Available for Linux, macOS, and Windows.
Against
- Race detection covers only code paths that run.
- Security fixes are issued for the two newest major releases.
The verdict
Go testing provides a command-line framework alongside fuzzing, benchmarking, profiling, and race detection. Its race detector has a clear limitation: it only finds races on paths exercised during tests.
Who it suits
It suits Go developers who want command-line testing, fuzzing, benchmarking, profiling, and race detection in their development workflow. It may also suit teams checking Go code for known vulnerabilities or working in regulated environments that use FIPS 140-3 compliant cryptography.
Plans and prices
Go
Open-source programming language; downloadable releases and source code
Read 7 Oct 2026 · go.dev
On the record
- Benchmarks and profiling
- The Go project describes its tooling as including built-in testing, benchmarking, and profiling frameworks.go.dev · read 7 Oct 2026
- CI integration
- The Go team provides a GitHub Action for govulncheck, and govulncheck's JSON output can support integration with other CI/CD systems.go.dev · read 7 Oct 2026
- Cryptography compliance
- Go's cryptography libraries can be used in FIPS 140-3 compliant mode for regulated environments.go.dev · read 7 Oct 2026
- Download platforms
- The downloads page lists releases for Windows, macOS, and Linux, along with source archives and other ports.go.dev · read 7 Oct 2026
- Fuzzing
- Go's standard toolchain supports native fuzzing, which continuously manipulates program inputs to find bugs.go.dev · read 7 Oct 2026
- Help and support
- The Go site directs users to community help on Stack Overflow and the Gophers Slack, and to the Go issue tracker for bugs.go.dev · read 7 Oct 2026
- Race detection
- Go includes a race detector that can be enabled for tests with `go test -race`, but it only finds races in code paths that run.go.dev · read 7 Oct 2026
- Security updates
- The Go team issues security fixes for the two most recent major releases.go.dev · read 7 Oct 2026
- Test discovery
- The test framework runs test functions named `TestXXX` in files ending in `_test.go`.go.dev · read 7 Oct 2026
- Testing framework
- Go has a lightweight test framework built from the `go test` command and the `testing` package.go.dev · read 7 Oct 2026
- Use cases
- The Go site describes use for cloud and network services, command-line interfaces, web development, DevOps, and site reliability engineering.go.dev · read 7 Oct 2026
- Verbose test output
- Running `go test -v` lists the tests and their results.go.dev · read 7 Oct 2026
- Vulnerability scanning
- The `govulncheck` tool identifies known vulnerabilities that affect code and prioritizes findings based on whether vulnerable functions or methods are called.go.dev · read 7 Oct 2026
- What it does
- Go is an open-source programming language supported by Google for building simple, secure, scalable systems.go.dev · read 7 Oct 2026