Remove duplication of function factory example

This commit is contained in:
Pete Hamilton 2014-07-05 12:03:09 +01:00
parent 25102363d8
commit 4c34096703

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.")