1. 首页
  2. 主题
  3. Go问与答

VS Code下使用scan系列函数报错

LoDawn · · 3870 次点击
各位好,小弟刚开始学习golang。我在VSCode编译使用了含有scan系列函数的代码,代码如下: <pre><code>package main import "fmt" func main(){ var RunType int fmt.Printf("输入类型:1or2") fmt.Scan(&RunType) fmt.Printf("%d",RunType) }</code></pre> 键盘输入值回车后显示我的输入值并报错,用CMD go run xxx.go正常。请问这个问题怎么解决呢?有没有办法在VSCode下面正常使用输入控制? (错误提示为:TypeError: Cannot read property 'currentGoroutine' of null\n at GoDebugSession.evaluateRequest at xxxxxxxxxxxxxxxxxxxxxx at xxxxxxxxxxxxxxxxxxxxxx ......)
vs code version: 1.18.0(64bits) 正常
#2
更多评论
你好,这个问题你是如何处理的,我也是这样。。
#1

用户登录

没有账号?注册

今日阅读排行

    加载中

一周阅读排行

    加载中