How do I print the full value of a string variable in delve?

Alex Altair picture Alex Altair · Sep 20, 2018 · Viewed 9.8k times · Source

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?

Answer

rustyx picture rustyx · Jul 4, 2019

Just to add to your answer, if you're using VS Code debugging feature, add the following config to your settings.json:

    "go.delveConfig": {
        "dlvLoadConfig": {
            "maxStringLen": 1024,
        },
        "apiVersion": 2,
    },