Created
September 9, 2015 19:39
-
-
Save josiah14/34a86ee2f69dd1721a6e to your computer and use it in GitHub Desktop.
interesting defer behavour
This file contains hidden or 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 "fmt" | |
func main() { | |
defer fmt.Println("world") | |
defer fmt.Println("dude") | |
defer println("sweet") | |
fmt.Println("hello") | |
} | |
=> | |
hello | |
dude | |
world | |
sweet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment