stdin in Goland console

Hi!

 

I'm trying to develop an application which accepts MFA OTP codes as part of its run. I have a small section of code which is not covered by test cases, which is the integration between the MFA components and the rest of the components, so I am trying to debug this with the break point debugger in GoLand.

I'm using https://github.com/AlecAivazis/survey for my input, and find that when I enter the OTP, the console does not seem to accept the carriage return as an end of line, and my app continues to wait.

When I run this in a bash terminal, it accepts my OTP. 

Is there any setting I need to change to make sure I can enter values on an interactive prompt on the console in Goland while using the break point debugger?

0
2 comments

Hi, if you are using Linux or OSX, then unfortunately this is currently not supported by the underlying debugger, delve.

There is currently an issue tracking this as well, please follow GO-4264 for updates on this.

The suggested workaround is to launch the process, attach delve manually to it, and then launch a Go Remote debugging configuration.

Hope this helps.

0

One hacky solution is to listen on a port and use the streams from the socket as os.stdout and os.stdin. Then telnet to the process as it run in devle. We do essentially that to get around it in some testing we do. If you need the code I can send it. Needs a bit of clean up. 

 

0

Please sign in to leave a comment.