windows 10 x86_64
go version go1.15.1 windows/amd64
vscode 1.49.2
vscode go extension 0.17.0

I learned something disappointing about debugging Go from VS Code.

Consider the following trivial program extracted from a larger program:

package main

var gvar int

func main() {
    var lvar int

    gvar = 1
    lvar = 1

    // To make this program compile.
    _ = lvar
}

To my surprise, the debugger doesn't show the global variable in
the "VARIABLES" display. It does show the local variable, and also
shows the local variable's value if you put the mouse cursor over
the variable.

The only way to see the global variable is to add it as an
expression to the "WATCH" display.

I googled this problem and found a posting from 2018 saying the
problem was fixed (https://github.com/microsoft/vscode-go/issues/1854)
so I don't know why I'm seeing what I'm seeing.

Any ideas/comments?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/33e40e3d-3a72-4f30-b02f-29149a5bfc44n%40googlegroups.com.

Reply via email to