我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

我如何使用gdb调试go测试

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.

近期文章

  • 从ajax请求并发写入文件
  • golang太多参数无法返回
  • 在Go中返回值而不是指针
  • 如何在Go中解码Apache Thrift有效负载?
  • 重命名后导入Golang相对软件包
  • 直接使用json.RawMessage的打印功能
  • Golang模板是基于角色的视图的更好方法
  • 如何从现有结构修改对象和结构?
  • golang:所有goroutine完成后如何关闭频道?
  • 扩展现有的类型测试。T以添加额外的检查
  • 如何在Golang回调中使用接口?
  • 这是一个块参数吗?
  • 在Google App Engine上部署我的应用程序的“ goapp deploy”和“ appcf.py”之间的区别?
  • Golang:如何终止/中止/取消入站HTTP请求而无响应?
  • 欺骗以快速查找在Go中引发错误的文件和行号?
  • 如何在Go中提供可选参数?
  • Git2go:在CreateCommit()之后,所有文件看起来都像添加了要删除的一样
  • Golang-无效的数组绑定
  • 如何在包中组织Go代码
  • 使用Go解组嵌套XML

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华