Last active
April 7, 2016 20:49
-
-
Save TripleDogDare/1fa13d3cf070e47ebcc94f2a5ad1f4c7 to your computer and use it in GitHub Desktop.
The Golang Defer Problem (https://play.golang.org/p/5e5fF130MX)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"sync" | |
"fmt" | |
) | |
func main() { | |
defer func() { | |
fmt.Println("If you see this then success!") | |
}() | |
go func() { | |
panic("whelp") | |
}() | |
deadlock := sync.Mutex{} | |
deadlock.Lock() | |
deadlock.Lock() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment