I have some go tests. I would like to debug with gdb.
But the binaries built by go test
are thrown away after running.
So how do I do it?
go 1.6 on windows/64
I have some go tests. I would like to debug with gdb.
But the binaries built by go test
are thrown away after running.
So how do I do it?
go 1.6 on windows/64
收起
You use go test -c
which will produce the executable file xyz.test
. Afterwards you use gdb xyz.test
to debug.
Just check go test --help
for an explanation of the -c
flag:
Compile the test binary to pkg.test but do not run it (where pkg is the last element of the package's import path). The file name can be changed with the -o flag.
报告相同问题?