Reputation: 99
i try to setup visual studio code for development with go language. i install go extension by lukehoban, and dev tools from: github.com/alecthomas/gometalinter and github.com/derekparker/delve/cmd/dlv
ide doesn't show any errors. when i run the following code:
package main
import "fmt"
func main() {
fmt.Print("Enter a number: ")
var input float64
fmt.Scanf("%f\n", &input)
output := input * 2
fmt.Println(output)
}
i cannot enter any data on step fmt.Scanf("%f\n", &input)
in debug console shows "debugger.go:413: nexting", but after enter any data process is stopped.
when i run the code without breakpoints i got:
TypeError: Cannot read property 'currentGoroutine' of null\n at GoDebugSession.evaluateRequest (C:\Users\a.holikau.vscode\extensions\lukehoban.Go-0.6.44\out\src\debugAdapter\goDebug.js:595:45)\n at GoDebugSession.DebugSession.dispatchRequest (C:\Users\a.holikau.vscode\extensions\lukehoban.Go-0.6.44\node_modules\vscode-debugadapter\lib\debugSession.js:421:22)\n at GoDebugSession.ProtocolServer._handleData (C:\Users\a.holikau.vscode\extensions\lukehoban.Go-0.6.44\node_modules\vscode-debugadapter\lib\protocol.js:104:38)\n at Socket. (C:\Users\a.holikau.vscode\extensions\lukehoban.Go-0.6.44\node_modules\vscode-debugadapter\lib\protocol.js:24:60)\n at emitOne (events.js:96:13)\n at Socket.emit (events.js:188:7)\n
at readableAddChunk (_stream_readable.js:176:18)\n at Socket.Readable.push (_stream_readable.js:134:10)\n at Pipe.onread (net.js:543:20)
any ideas how to fix it ?
Upvotes: 1
Views: 1177
Reputation: 37763
Going based on the stack trace that you provided, I'm going to say that this is an issue with the Go extension.
You should check the extension's official GitHub repository to see if the issue has already been reported, and, if not you should go ahead and report it. If this is indeed an issue with the extension, they should hopefully be able to fix it.
If it turns out that this is actually an issue with the way you've configured the extension, they should be able to provide you more information about fixing it.
Best of luck!
Upvotes: 1