-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Printing an error type should print result of .Error()
#60
Comments
I explored code a little for this. If nobody is working on variable printing then I'd like to take this up next. It will require thinking a bit since there are more of similar type in line [ #61 #116 #117 #122 ] Have you thought about how to go about this? Should use a pretty printer package? It can get really messy if we think of all of these together. |
I've thought a bit about this and IMHO the optimal way to do this is in three steps
Printing the value of an expression like that would then be automatic. AFAIK you won't be able to use a pretty printer because those use reflect that's not going to work across processes. |
@aarzilli you're correct and that sounds like a reasonable plan for the other issues mentioned by @Omie. This issue does not deal with evaluation based off of an expression, it involves adding functionality to call a Go function and store the return value(s) and then essentially print the |
@derekparker, I think more general functionality to display a variable as May be a new command can be introduced for this: Dealing with breakpoints inside |
@kostya-sh are you thinking of trying to use the format string and have Delve eval the variables used and then create the formatted string itself? That's kind of interesting, and could lead to the type of command you've suggested. Either way, we're still going to need to land #119 eventually before 1.0 and it would be nice to just be able to use that to "call" the |
@derekparker, no, my example of a new command wasn't very clear.
making a new command unnecessary. |
it's been a while here. Is this issue still open? I'm not an expert, I only recently started using go. I would love to take this up, could someone just give me a few pointers about where to start digging at the source? |
@gideondsouza you would have to first implement function calls, the problem there is interacting with the go runtime in a way that isn't fragile and doesn't upset the runtime: figure out how if there is enough stack space, extend the stack if there isn't enough for the call, deal with panics caused by the injected call, figure out how to make the garbage collector happy about a stack frame that would normally be impossible. |
As a user, I'd really prefer to see the value of the error if I'm step-through debugging / tracing. Maybe this should be some kind of "alternate" print command, like "render" or "format"? (That could also be useful for rendering things like byte buffers, maybe using |
@binary132 I'm not sure I completely understand what you mean. The string returned from |
Yes, If I had my pick, I'd take what @kostya-sh suggested. If forced to choose between |
@binary132 Ah, I understand what you're saying. Makes sense. |
Going to close this out as technically this is possible now. You can execute |
* [#176084395] Changed the sms response json * [#176084395] Checked and fixed up webhook json format
Haven't looked into this - but ideally, printing an error type should return the value of its
Error
method.The text was updated successfully, but these errors were encountered: