For the following code:
package main
import "fmt"
type intFunc func(int) int
var t = func() intFunc {
a := func(b int) int { return b}
return a
}
func main() {
fmt.Println(t()(2))
}
Is there a way to return the pointer to the function instead of the function directly? (something like return &a
)?
The playground is here: https://play.golang.org/p/IobCtRjVVX