V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
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 · 3037 views
    This topic created in 1762 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
        1
    i4t  
       Jul 1, 2021 via iPhone
    你就不能 cmd 通过命令行执行 go build 吗
    sen2
        2
    sen2  
    OP
       Jul 1, 2021
    @i4t 那怎么设置断点
    kidlj
        3
    kidlj  
       Jul 1, 2021
    除非调试第三方包使用断点,自己的代码一般用 fmt.Print 调试。
    sky96111
        4
    sky96111  
       Jul 1, 2021 via Android
    https://github.com/microsoft/vscode-go/issues/219
    嫌麻烦所以我换了 Goland…
    fiypig
        5
    fiypig  
       Jul 1, 2021
    可以断点的, 要配置
    eudore
        6
    eudore  
       Jul 1, 2021
    不用 win 不用 vsc 不用 scan
    ArJun
        7
    ArJun  
       Jul 1, 2021
    要装插件,相对麻烦一些
    imherer
        8
    imherer  
       Jul 1, 2021
    直接断点就好了呀
    Akiya
        9
    Akiya  
       Jul 1, 2021 via iPhone
    改用读文件不用 scan
    sen2
        10
    sen2  
    OP
       Jul 2, 2021
    @sky96111 goland 要花钱的吧
    sky96111
        11
    sky96111  
       Jul 3, 2021 via Android
    @sen2 学生,非商业项目免费
    sen2
        12
    sen2  
    OP
       Jul 5, 2021
    @fiypig 可以用 terminal 调试打断点么?
    bushenx
        13
    bushenx  
       Jul 11, 2021
    vscode launch.json 中可以配置命令行输入的参数
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   946 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 21:16 · PVG 05:16 · LAX 14:16 · JFK 17:16
    ♥ Do have faith in what you're doing.