我有一些围棋测试。我想用 gdb 调试。
但是go test
构建的二进制文件运行后就被扔掉了。
那我该怎么做呢?
在 windows/64 上运行 1.6
最佳答案
您使用 go test -c
将生成可执行文件 xyz.test
。然后使用 gdb xyz.test
进行调试。
只需检查 go test --help
以获取对 -c
标志的解释:
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.
关于go - 如何使用 gdb 调试 go 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36223429/