|
|
|
|
|
by tapirl
90 days ago
|
|
It looks the following code will be rewritten badly, but no ways to avoid it? If this is true, maybe the blog article should mention this. package main
//go:fix inline
func handle() {
recover()
}
func foo() {
handle()
}
func main() {
defer foo()
panic("bye")
}
|
|
Yes, maybe some code uses recover() to check if its being called as a panic handler, and perhaps `go fix` should add a check for this ("error: function to be inlined calls recover()"), but this isn't a particularly common footgun.