dourao1896 2018-09-20 01:30
浏览 427

如何在delve中打印字符串变量的完整值?

I'm using the delve go debugger to debug some code. When I try to print a string variable, it gives me an abbreviated version.

(dlv) print myString
"my string...+539 more"

How do I get it to print the full string?

  • 写回答

2条回答 默认 最新

  • dorv56831 2018-09-20 01:30
    关注

    The ability to configure the length of printed strings was recently added to delve. To see the full list of configuration options, run config -list;

    (dlv) config -list
    aliases            map[]
    substitute-path    []
    max-string-len     <not defined>
    max-array-values   <not defined>
    show-location-expr false
    

    The one we're interested in here is called max-string-len, which you can see is currently <not defined>. To increase the length to e.g. 1000, run

    (dlv) config max-string-len 1000
    

    Now running print myString should print the whole string.

    评论

报告相同问题?

悬赏问题

  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题