Created
February 6, 2014 20:48
-
-
Save kreshikhin/8852210 to your computer and use it in GitHub Desktop.
This file contains 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 add(x, y int, callback func(int)) { | |
sum := x + y | |
callback(sum) | |
} | |
func main() { | |
add(2, 3, func(result int){ | |
fmt.Println(result) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment