Skip to content

runtime: Go 1.25 panic message changes are not applied universally #73923

Closed
@zigo101

Description

@zigo101

Go version

go version go1.25-devel_7f806c1052 Wed May 21 00:07:41 2025 -0700 linux/amd64

Output of go env in your module/workspace:

.

What did you do?

package main

var v any = 123

func main() {
    defer func() {
        var x = recover()
        _ = x
        panic(v)
    }()
    
    panic(v)
}

// panic: 123 [recovered, repanicked
package main

var v any = 123
var v2 any = v

func main() {
    defer func() {
        var x = recover()
        _ = x
        panic(v2)
    }()
    
    panic(v)
}

// panic: 123 [recovered, repanicked]
package main

var v any = 123
var v2 any = 123

func main() {
    defer func() {
        var x = recover()
        _ = x
        panic(v2)
    }()
    
    panic(v)
}

// panic: 123 [recovered]
//	panic: 123
package main

const n = 0

func main() {
    defer func() {
        var x = recover()
        _ = x
        panic(123 + n)
    }()
    
    panic(123)
}

// panic: 123 [recovered, repanicked]
package main

var n = 0

func main() {
    defer func() {
        var x = recover()
        _ = x
        panic(123 + n)
    }()
    
    panic(123)
}

// panic: 123 [recovered]
//	panic: 123

What did you see happen?

The messages depends on many factors.

What did you expect to see?

The messages should not depend on some factors.

(This is really not a big problem. Just filed it for fun.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions