mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
1.2 KiB
1.2 KiB
Configure Max String Print Length For Delve
During a Delve debugging session, we can
print out the value of a given variable with the print command. Similarly, we
can see the values of all local variables with the locals command.
Whenever Delve is printing out strings and slices, it will truncate what it displays to 64 characters (or items) by default.
(dlv) print diagnostics.Solutions[0]
"295743861\n431865972\n876192543\n387459216\n612387495\n549216738\n7635...+25 more"
This can be overridden by changing the config of
max-string-len
to something longer. In my case here, all I need are about 90 characters to
display my full string, so run config max-string-len 90 from the dlv
session.
(dlv) config max-string-len 90
(dlv) print diagnostics.Solutions[0]
"295743861\n431865972\n876192543\n387459216\n612387495\n549216738\n763524189\n928671354\n154938627"
Now I can see the entire string instead of the truncated version.