duanguan3863 2016-10-13 15:47
浏览 44

使用go extension在Visual Studio代码中输入数据

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
", &input)

    output := input * 2

    fmt.Println(output)    
}

i cannot enter any data on step fmt.Scanf("%f ", &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 at GoDebugSession.evaluateRequest (C:\Users\a.holikau.vscode\extensions\lukehoban.Go-0.6.44\out\src\debugAdapter\goDebug.js:595:45) at GoDebugSession.DebugSession.dispatchRequest (C:\Users\a.holikau.vscode\extensions\lukehoban.Go-0.6.44 ode_modules\vscode-debugadapter\lib\debugSession.js:421:22) at GoDebugSession.ProtocolServer._handleData (C:\Users\a.holikau.vscode\extensions\lukehoban.Go-0.6.44 ode_modules\vscode-debugadapter\lib\protocol.js:104:38) at Socket. (C:\Users\a.holikau.vscode\extensions\lukehoban.Go-0.6.44 ode_modules\vscode-debugadapter\lib\protocol.js:24:60) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18) at Socket.Readable.push (_stream_readable.js:134:10) at Pipe.onread (net.js:543:20)

any ideas how to fix it ?

  • 写回答

1条回答 默认 最新

  • dongyoufo5672 2016-10-13 19:38
    关注

    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!

    评论

报告相同问题?

悬赏问题

  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用