Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (14 sloc) 247 Bytes
package main
import "fmt"
type myFunc func() string
func (f myFunc) WrapFunc() {
fmt.Print("before msg\n")
fmt.Printf("%s\n", f())
fmt.Print("after msg\n")
}
func main() {
f := myFunc(func() string {
return "hello!!"
})
f.WrapFunc()
}