- 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
- Cloud and network development
- Go supports cloud and network services through ecosystems of tools and APIs on major cloud providers.go.dev · read 18 Nov 2026
- Command-line development
- Go can be used to create command-line interfaces with open-source packages and its standard library.go.dev · read 18 Nov 2026
- Compilation and runtime
- Go programs compile ahead of time to native machine code; variant implementations can target JavaScript or WebAssembly.go.dev · read 18 Nov 2026
- Concurrency and library
- The language includes built-in concurrency and a robust standard library.go.dev · read 18 Nov 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
- iOS support
- Go's minimum requirements page lists iOS 12 or later as supported.go.dev · read 18 Nov 2026
- Language identity
- Go is an open-source programming language supported by Google.go.dev · read 18 Nov 2026
- Module security infrastructure
- The go command uses Google's module mirror and checksum database by default to download and authenticate modules.go.dev · read 18 Nov 2026
- Official operating-system downloads
- Official packages are provided for Windows, macOS, and Linux.go.dev · read 18 Nov 2026
- Open-source licensing
- The Go project is distributed under a BSD-style license.go.dev · read 18 Nov 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