Pergi fungsi bersarang di golang
package main
import "fmt"
// outer function
func greet(name string) {
// inner function
var displayName = func() {
fmt.Println("Hi", name)
}
// calling inner function
displayName()
}
func main() {
// calling outer function
greet("John") // Hi John
}
SAMER SAEID