VS code restarts when an infinite loop runs in Golang but not for python

Viewed 56

I have a program that runs an infinite loop:

func main(){
    fmt.Println("welcome  to Goalang World!")
    for i:=0;true;i++{
        fmt.Println("1: ", "g")
    }
}

If I run this code then VS code terminates with below message in terminal:

Restarting the terminal because the connection to the shell process was lost.

But no issue when running infinite loop in python.

Do i need to change any terminal settings in my VScode?

Note: Same code works fine in https://go.dev/play/

0 Answers
Related