我如何设置vscode从调试控制台输入参数

时间:2020-05-27 06:11:46

标签: go debugging visual-studio-code

我通过vscode调试代码,控制台立即显示“ hello and”, 程序退出0,导致我无法输入a1和a2,那么如何设置vscode?

如下所示的go代码

package main
import "fmt"
func main(){
    fmt.Println("Please enter your firstname and lastname")
    var a1,a2 string
    fmt.Scan(&a1,&a2)       // it don't stop to wait my input data.
    fmt.Println("hello ",a1," and ",a2)
}

0 个答案:

没有答案