golang / vscode-go

Go extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=golang.Go
Other
3.8k stars 730 forks source link

How to process more than one returns from function in Evaluate Expression? #3137

Closed BongBongBang closed 6 months ago

BongBongBang commented 6 months ago

Is your feature request related to a problem? Please describe. If there is a function return a []byte and a error, how do i process the []byte like string([]byte)? call bytes, _ := function does not work.

Describe the solution you'd like Could store the return in some variable

Describe alternatives you've considered nothing

Additional context nothing.

hyangah commented 6 months ago

Unfortunately, it's not possible to do the conversion in that way. That's a limitation of the go debugger (delve).

However, the default view does "string" conversion as you expand the returned value. Keep expanding the returned value and find string() field.

Screenshot 2024-01-18 at 2 59 18 PM
BongBongBang commented 6 months ago

yeah, the 'expanding' solution is ok if one of the return value is []byte] , but indeed , what i met was a readable.....I cannot watch its value if there is not any process of it....right ?Or, is there any solution?