Doug Smith
Doug Smith

Reputation: 29326

How do I "print" the value of objects to the console with Go's Delve and Visual Studio Code?

I have the "Delve" debugger setup for Go with Visual Studio code and a super simple program. If I set a breakpoint, and I want to print a variable declared earlier, I'm used to being able to say po foo to print out the value of the object foo to the console, but Visual Studio Code just complains about "expected 'EOF'".

How do I print? If I wanted to test things out by printing out values, does Delve not support that?

Upvotes: 2

Views: 1399

Answers (1)

AJR
AJR

Reputation: 1681

In debug console type foo (without po prefix)

Upvotes: 3

Related Questions