[Go] Run one test by name with go test -run

Created on November 30, 2026

You can pass a regular expression to go test -run to select tests by name. If the current package contains a test named TestAddNumbers, this command selects it.

go test -run '^TestAddNumbers$'

The anchors ^ and $ require the full test name to match, so a test named TestAddNumbersNegative is skipped.

Go