Thanks to visit codestin.com
Credit goes to github.com

Skip to content

defer recover() should not actually recover. #1127

Open
@nevkontakte

Description

@nevkontakte

Consider the following program:

package main

func main() {
	defer recover()
	panic(1)
}

Compare upstream vs gopherjs:

$ go run main.go
panic: 1

goroutine 1 [running]:
main.main()
        /home/aleks/git/repro/035-defer-recover/main.go:5 +0x65
exit status 2
$ gopherjs run main.go
# No errors

While this may seem counter-intuitive, this is WAI according to golang/go#1272.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions