The Go Programming Language
› http://golang.org/
› Go Playground
Go Projects
› Revel Web Framework
sen2

win 下, golang 大佬是怎样用 vscode debug 的? console 里不能读键盘 input 咋整?

  •  
  •   sen2 · Jul 1, 2021 · 3380 views
    This topic created in 1963 days ago, the information mentioned may be changed or developed.

    当 fmt.Scan() 时候,vscode 的 debug console 就无法读取键盘输入,就无法继续调试。

    查了各种方法都没有搞定,求问各位大佬有没有方便调试的解决办法。

    13 replies  •  2021-07-11 22:52:35 +08:00
    i4t
    i4t
    Jul 1, 2021 via iPhone
    1
    你就不能 cmd 通过命令行执行 go build 吗
    sen2
    sen2
    OP
    Jul 1, 2021
    2
    @i4t 那怎么设置断点
    kidlj
    kidlj
    Jul 1, 2021
    3
    除非调试第三方包使用断点,自己的代码一般用 fmt.Print 调试。
    sky96111
    sky96111
    Jul 1, 2021 via Android
    4
    https://github.com/microsoft/vscode-go/issues/219
    嫌麻烦所以我换了 Goland…
    fiypig
    fiypig
    Jul 1, 2021
    5
    可以断点的, 要配置
    eudore
    eudore
    Jul 1, 2021
    6
    不用 win 不用 vsc 不用 scan
    ArJun
    ArJun
    Jul 1, 2021
    7
    要装插件,相对麻烦一些
    imherer
    imherer
    Jul 1, 2021
    8
    直接断点就好了呀
    Akiya
    Akiya
    Jul 1, 2021 via iPhone
    9
    改用读文件不用 scan
    sen2
    sen2
    OP
    Jul 2, 2021
    10
    @sky96111 goland 要花钱的吧
    sky96111
    sky96111
    Jul 3, 2021 via Android
    11
    @sen2 学生,非商业项目免费
    sen2
    sen2
    OP
    Jul 5, 2021
    12
    @fiypig 可以用 terminal 调试打断点么?
    bushenx
    bushenx
    Jul 11, 2021
    13
    vscode launch.json 中可以配置命令行输入的参数
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2038 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 12:27 · PVG 20:27 · LAX 04:27 · JFK 07:27
    ♥ Do have faith in what you're doing.