When I click the “debug benchmark” or “debug test” options that Microsoft Visual Studio Code adds above my func Test_
and func Benchmark_
line, I get taken to the debug consle which is displaying messages like the following:
Build Error: go test -c -o /home/.../dirwithtestin/__debug_bin1879621140 -gcflags all=-N -l -race .
# internal/godebugs
compile: version "go1.21.10" does not match go tool version "go1.22.5"
# internal/unsafeheader
compile: version "go1.21.10" does not match go tool version "go1.22.5"
How do I resolve the “compile: version “go1.21.10” does not match go tool version “go1.22.5” warnings?
My regular runs of the tests and generation of the main application work fine. I attempted to set "dlvFlags": ["--check-go-version=false"]
as suggested under Go dlv: Failed to launch Version of go is too old for this verion of delve. VSCode Golang dlv debug error for version mismatch looks similar but I could not figure out what “Had a stale go bin reference in VSCode User settings.” meant.