golang / tour

[mirror] A Tour of Go
BSD 3-Clause "New" or "Revised" License
1.55k stars 520 forks source link

tour: no error produced for infinite recursion #1570

Open krelinga opened 9 months ago

krelinga commented 9 months ago

Context: https://go.dev/tour/concurrency/10

This isn't specifically related to the tour, but I discovered it while working on this exercise.

Here's some simplified code that triggers the case I'm seeing:

package main

func main() {
    main()
}

When I run this code the only feedback that I get is Program exited. This is in contrast to other similar cases, for example the infinite loop caused by for {}, where I get an error message like timeout running program in addition to Program exited. Just a guess, but maybe there's some error related to max stack depth that isn't getting propagated to the UI?