Created
February 3, 2014 15:31
-
-
Save alehano/8785933 to your computer and use it in GitHub Desktop.
Revisions
-
alehano created this gist
Feb 3, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ package main import ( "fmt" ) func decorator(f func(s string)) func(s string) { return func(s string) { fmt.Println("Started") f(s) fmt.Println("Done") } } func doSomething(s string) { fmt.Println(s) } func main() { decorator(doSomething)("Do something") }