-
VScode's support for Golang is mostly excellent. One nit I have is when debugging|stepping through code, I'd prefer to not have to step through each line of multiline statements e.g. struct literals: d := &Dog{
Name: "Freddie",
Age: 2,
}
log.Printf("%+v", d) Putting a breakpoint at At first I suspected, it was deconstructing the literal into e.g. This behavior also occurs in other statements spread across multiple lines, e.g.: log.Info("Log something",
"Name", d.Name,
"Age", d.Age,
) I prefer this layout for readability but it's a pain when stepping through the code. Curiously, the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
That is related to how go is generating the debug info.
When I want to skip many lines, I just place a new breakpoint up to the point that I want to skip and run continue. The second example code is really a different code - e.g. no Dog object creation ( |
Beta Was this translation helpful? Give feedback.
That is related to how go is generating the debug info.