package main
func main() {
f()
}
func f() {
back := func() {
return
}
back:
for {
back()
continue back
}
}
Running
$ /usr/local/go1.23/bin/go version
go version go1.23.0 darwin/arm64
$ /usr/local/go1.23/bin/go run ./closure.go # blocks here, eats 100% of a CPU core
^Csignal: interrupt
/usr/local/go1.22/bin/go version
go version go1.22.6 darwin/arm64
$ /usr/local/go1.22/bin/go run ./closure.go # block here as well
^Csignal: interrupt
What did you see happen?
described above ^
What did you expect to see?
Expected both snippets to compile successfully with both latest go versions.
Go version
go version go1.23.0 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
Made a closure.
https://go.dev/play/p/iHDHusD_Lqa
Running
What did you see happen?
described above ^
What did you expect to see?
Expected both snippets to compile successfully with both latest go versions.