Skip to content

Instantly share code, notes, and snippets.

@TripleDogDare
Last active April 7, 2016 20:49
Show Gist options
  • Save TripleDogDare/1fa13d3cf070e47ebcc94f2a5ad1f4c7 to your computer and use it in GitHub Desktop.
Save TripleDogDare/1fa13d3cf070e47ebcc94f2a5ad1f4c7 to your computer and use it in GitHub Desktop.
The Golang Defer Problem (https://play.golang.org/p/5e5fF130MX)
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