Skip to content

defer recover() doesn't run #1272

@dadkins

Description

@dadkins
The following program ends in a panic, though I would have expected the deferred
recover() to catch it.

package main

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

Note: "defer func { recover() }()" works as expected.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions