1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-12 09:44:24 +02:00

Merge pull request #664 from petehamilton/patch-1

Remove duplication of function factory example
This commit is contained in:
Levi Bostian
2014-07-06 11:11:48 -05:00

View File

@@ -214,13 +214,6 @@ func sentenceFactory(mystring string) func(before, after string) string {
}
}
// Next two are equivalent, with second being more practical
fmt.Println(learnFunctionFactory("summer")("A beautiful", "day!"))
d := learnFunctionFactory("summer")
fmt.Println(d("A beautiful", "day!"))
fmt.Println(d("A lazy", "afternoon!"))
func learnDefer() (ok bool) {
// Deferred statements are executed just before the function returns.
defer fmt.Println("deferred statements execute in reverse (LIFO) order.")