Skip to content

run test | debug test is not appearing for Table Driven Tests #3962

@swathinsankaran

Description

@swathinsankaran

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
    • 1.25.5
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    • 0.21.0
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • 1.107.1
  • Check your installed extensions to get the version of the VS Code Go extension
    • 0.52.1
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
# Tools Configuration


## Environment

GOBIN: undefined
toolsGopath: 
gopath: C:\Users\<username>\go
GOROOT: C:\Program Files\Go
PATH: C:\Program Files\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files\Go\bin;C:\Program Files\nodejs\;C:\Users\<username>\AppData\Local\Microsoft\WindowsApps;C:\Users\<username>\go\bin;C:\Users\<username>\AppData\Local\Programs\Ollama;C:\Users\<username>\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\<username>\AppData\Local\Programs\Zed\bin;C:\Users\<username>\AppData\Roaming\npm

## Tools

	go:	C:\Program Files\Go\bin\go.exe: go version go1.25.5 windows/amd64

	gotests:	not installed
	impl:	not installed
	goplay:	not installed
	dlv:	C:\Users\<username>\go\bin\dlv.exe	(version: v1.26.0 built with go: go1.25.5)
	gopls:	C:\Users\<username>\go\bin\gopls.exe	(version: v0.21.0 built with go: go1.25.5)

## Go env

Workspace Folder (src): c:\Users\<username>\go\src

	set AR=ar
	set CC=gcc
	set CGO_CFLAGS=-O2 -g
	set CGO_CPPFLAGS=
	set CGO_CXXFLAGS=-O2 -g
	set CGO_ENABLED=0
	set CGO_FFLAGS=-O2 -g
	set CGO_LDFLAGS=-O2 -g
	set CXX=g++
	set GCCGO=gccgo
	set GO111MODULE=
	set GOAMD64=v1
	set GOARCH=amd64
	set GOAUTH=netrc
	set GOBIN=
	set GOCACHE=C:\Users\<username>\AppData\Local\go-build
	set GOCACHEPROG=
	set GODEBUG=
	set GOENV=C:\Users\<username>\AppData\Roaming\go\env
	set GOEXE=.exe
	set GOEXPERIMENT=
	set GOFIPS140=off
	set GOFLAGS=
	set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\<username>\AppData\Local\Temp\go-build1030655150=/tmp/go-build -gno-record-gcc-switches
	set GOHOSTARCH=amd64
	set GOHOSTOS=windows
	set GOINSECURE=
	set GOMOD=NUL
	set GOMODCACHE=C:\Users\<username>\go\pkg\mod
	set GONOPROXY=
	set GONOSUMDB=
	set GOOS=windows
	set GOPATH=C:\Users\<username>\go
	set GOPRIVATE=
	set GOPROXY=https://proxy.golang.org,direct
	set GOROOT=C:\Program Files\Go
	set GOSUMDB=sum.golang.org
	set GOTELEMETRY=local
	set GOTELEMETRYDIR=C:\Users\<username>\AppData\Roaming\go\telemetry
	set GOTMPDIR=
	set GOTOOLCHAIN=auto
	set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
	set GOVCS=
	set GOVERSION=go1.25.5
	set GOWORK=
	set PKG_CONFIG=pkg-config

Share the Go related settings you have added/edited

Run Preferences: Open Settings (JSON) command to open your settings.json file.
Share all the settings with the go. or ["go"] or gopls prefixes.

Describe the bug

run test | debug test only appears when the name of the test is given inline. For a table-driven test, a variable holds the subtest name.

Steps to reproduce the behavior:

  1. Create a test file with table-driven tests

Screenshots or recordings

Option visible

Image

Option invisible for Table Driven Tests

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions